<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How To - Update a Value in a Table in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831136#M3317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would check out the &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing"&gt;ProConcepts Editing&lt;/A&gt; help topic. &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#search-for-layer-features-and-update-a-field"&gt;This snippet&lt;/A&gt;&amp;nbsp;can probably be modified to solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jul 2019 18:08:38 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2019-07-12T18:08:38Z</dc:date>
    <item>
      <title>How To - Update a Value in a Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831135#M3316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to know how I can update a value in a table.&lt;/P&gt;&lt;P&gt;Here is my first go from looking at all the examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;RowCursor cursor = profilesByStation.Search(null, false);
            string nameoftable = profilesByStation.GetName();


            int riverField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileRiverCode"));
            int reachField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileReachCode"));
            int stationField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileStation"));


            int measField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileRef"));
            string refMileField = General.MMCProperties.Instance.getPropertyAsString("FieldsXsRefMile");

            if (riverField == -1 || reachField == -1 || stationField == -1 || measField == -1) {
                System.Windows.Forms.MessageBox.Show("An error was encountered when trying to update the refmile data. The river field, reach field, station field, or measField was not found.\r\n");
                return;
            }


            while (cursor.MoveNext()) {
                Row row = cursor.Current;

                object river = row[riverField];
                object reach = row[reachField];
                object station = row[stationField];

                if (!(river is System.DBNull || reach is System.DBNull || station is System.DBNull)) {
                    Models.XSecLocate xSecLocate = Models.XSecLocate.findXSecLocate(xSecLocateList,Convert.ToString(river),Convert.ToString(reach),Convert.ToDouble(station),true);
                    if (xSecLocate != null) {
                        row[measField] = xSecLocate.Meas;
                        row[refMileField] = xSecLocate.Meas;
                    }
                }


            }&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I am updating the row/column field value by&amp;nbsp;&lt;/P&gt;&lt;P&gt;row[refMileField] = xSecLocate.Meas;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I do this, it doesn't appear that anything in my table was updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:02:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831135#M3316</guid>
      <dc:creator>JamesKennedy1</dc:creator>
      <dc:date>2021-12-12T10:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: How To - Update a Value in a Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831136#M3317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would check out the &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing"&gt;ProConcepts Editing&lt;/A&gt; help topic. &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#search-for-layer-features-and-update-a-field"&gt;This snippet&lt;/A&gt;&amp;nbsp;can probably be modified to solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 18:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831136#M3317</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-07-12T18:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How To - Update a Value in a Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831137#M3318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for that. I am now using the code&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
                        modifyOp.Name = "Update Fields";
                        modifyOp.Modify(row, measField, xSecLocate.Meas);
                        //modifyOp.Modify(row, refMileField, xSecLocate.Meas);
                        modifyOp.Execute();&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However it appears to be going very slow. I have a table of roughly 600,000 points. Updating each row is quite long. Is there a way to increase the speed of it? Or is there a more optimized approach to doing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:02:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831137#M3318</guid>
      <dc:creator>JamesKennedy1</dc:creator>
      <dc:date>2021-12-12T10:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: How To - Update a Value in a Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831138#M3319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you updating each row in its own EditOperation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or all you calling modifyOp.Modify() 600,000 times for the single&amp;nbsp;call to new EditOperation()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2019 19:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831138#M3319</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-07-15T19:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How To - Update a Value in a Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831139#M3320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the advice, I'll change that so it just does it in one EditOperation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 20:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-update-a-value-in-a-table/m-p/831139#M3320</guid>
      <dc:creator>JamesKennedy1</dc:creator>
      <dc:date>2019-07-23T20:01:04Z</dc:date>
    </item>
  </channel>
</rss>

