<?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: iterate through rows of feature service in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498057#M11761</link>
    <description>&lt;P&gt;I have made some progress, now the issue is it throws the error that the table cant be found, yet i get the name from the item, i cant believe this is so difficult&lt;/P&gt;&lt;LI-CODE lang="c"&gt;foreach (var pi in portalItems)
{
    if (pi.Name == &amp;lt;TABLE_NAME&amp;gt;)
    {
        MessageBox.Show($"ITEM : {pi}");
        MessageBox.Show($"ITEM NAME : {pi.Name}");
        MessageBox.Show($"ITEM NAME : {pi.Path}");                  
      

        Uri uri = new Uri(pi.Path);
        ServiceConnectionProperties serviceConnectionProperties = new ServiceConnectionProperties(uri);
        using (Geodatabase geodatabase = new Geodatabase(serviceConnectionProperties))
        {
            using (Table table = geodatabase.OpenDataset&amp;lt;Table&amp;gt;(pi.Name))
            {                
                
                using (RowCursor rowCursor = table.Search(null,false))
                {
                    while (rowCursor.MoveNext())
                    {
                        using (Row row = rowCursor.Current)
                        {
                            string val = Convert.ToString(row["NAME"]);
                            MessageBox.Show(val);
                        }
                    }
                }

            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 05:02:43 GMT</pubDate>
    <dc:creator>AntDevEsk</dc:creator>
    <dc:date>2024-06-27T05:02:43Z</dc:date>
    <item>
      <title>iterate through rows of feature service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498035#M11760</link>
      <description>&lt;P&gt;how do i iterate through the rows of a feature service form portal?&lt;/P&gt;&lt;P&gt;i have a list of portal items as per this url&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic18204.html" target="_blank"&gt;CreateForItemsOfType Method—ArcGIS Pro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;i can iterate through and get the item name etc but&amp;nbsp;how do i do the equivalent of a python searchCursor?&amp;nbsp;&lt;/P&gt;&lt;P&gt;i just want to find a value in a field.&lt;/P&gt;&lt;P&gt;i have searched for hours, what am i missing?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 02:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498035#M11760</guid>
      <dc:creator>AntDevEsk</dc:creator>
      <dc:date>2024-06-27T02:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: iterate through rows of feature service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498057#M11761</link>
      <description>&lt;P&gt;I have made some progress, now the issue is it throws the error that the table cant be found, yet i get the name from the item, i cant believe this is so difficult&lt;/P&gt;&lt;LI-CODE lang="c"&gt;foreach (var pi in portalItems)
{
    if (pi.Name == &amp;lt;TABLE_NAME&amp;gt;)
    {
        MessageBox.Show($"ITEM : {pi}");
        MessageBox.Show($"ITEM NAME : {pi.Name}");
        MessageBox.Show($"ITEM NAME : {pi.Path}");                  
      

        Uri uri = new Uri(pi.Path);
        ServiceConnectionProperties serviceConnectionProperties = new ServiceConnectionProperties(uri);
        using (Geodatabase geodatabase = new Geodatabase(serviceConnectionProperties))
        {
            using (Table table = geodatabase.OpenDataset&amp;lt;Table&amp;gt;(pi.Name))
            {                
                
                using (RowCursor rowCursor = table.Search(null,false))
                {
                    while (rowCursor.MoveNext())
                    {
                        using (Row row = rowCursor.Current)
                        {
                            string val = Convert.ToString(row["NAME"]);
                            MessageBox.Show(val);
                        }
                    }
                }

            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 05:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498057#M11761</guid>
      <dc:creator>AntDevEsk</dc:creator>
      <dc:date>2024-06-27T05:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: iterate through rows of feature service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498063#M11762</link>
      <description>&lt;P&gt;solved&amp;nbsp;&lt;/P&gt;&lt;P&gt;need to have the table name with the layer index of the table as a prefix, in my case it is Layer 1 so its prefixed with "L0", i.e&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;using (Table table = geodatabase.OpenDataset&amp;lt;Table&amp;gt;($"L0{pi.Name}"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 05:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/iterate-through-rows-of-feature-service/m-p/1498063#M11762</guid>
      <dc:creator>AntDevEsk</dc:creator>
      <dc:date>2024-06-27T05:29:48Z</dc:date>
    </item>
  </channel>
</rss>

