<?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: ArcGIS Pro Add-In:  How to load spatial SQL Server table to project's active map using C#? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133970#M7615</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; I encountered "two-step" errors:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; First, my connections string for the sde was wrong.&amp;nbsp; The correct one was (I renamed the table fearing I was encountering character limit in my name):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;string url = @"E:\WorkingFolder\SWATAddIn\MGConnection.sde\MG.dbo.AxSwCompare";&lt;BR /&gt;&lt;BR /&gt;The dot-dbo notation should be specified:&amp;nbsp; "\databaseName.dbo.tableName".&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Next, the table in sde geodatabase didn't have OBJECTIDs, so ArcGIS Pro was throwing an exception.&amp;nbsp; I have to modify the SQL Server table to add OBJECTIDs as IDENTITY-type.&lt;/P&gt;&lt;P&gt;It was able to load the shapefile after I did the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the link.&amp;nbsp; It was very helpful.&amp;nbsp; I couldn't have found them on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jan 2022 17:45:57 GMT</pubDate>
    <dc:creator>JadedEarth</dc:creator>
    <dc:date>2022-01-14T17:45:57Z</dc:date>
    <item>
      <title>ArcGIS Pro Add-In:  How to load spatial SQL Server table to project's active map using C#?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133815#M7610</link>
      <description>&lt;P&gt;I'm new to ArcGIS Pro SDK. I have an Add-in app that performs queries, joins etc. using SQL Server&lt;BR /&gt;databases.&amp;nbsp; There are multiple databases, tables, and joins involved so I use SQL Server environment to perform all the query, search, and join operations.&lt;/P&gt;&lt;P&gt;After all queries are done, I want to display the resulting spatial table on the ArcGIS Pro project map (result is basically a polygon shapefile).&lt;/P&gt;&lt;P&gt;However, although SQL Server table has shape, it doesn't have a spatial reference. I want to use&lt;BR /&gt;Albers Equal Area Conic-USGS (I think it has a spatial reference SR_wkid = 6703).&lt;/P&gt;&lt;P&gt;How do I load the spatial SQL Server table (with spatial reference) onto the Active map using C# from my Add-In app?&amp;nbsp; I have created a database connection to the SQL Server database.&amp;nbsp; So my parameters look like this:&lt;/P&gt;&lt;P&gt;srcPath = "E:\WorkingFolder\MyAddIn\GISTMPConnection.sde";&lt;BR /&gt;in_features = "APEX_SWAT_COMP_HUC8";&lt;BR /&gt;out_layer = "ApexSwatCompare_layer";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 12:47:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133815#M7610</guid>
      <dc:creator>JadedEarth</dc:creator>
      <dc:date>2022-01-14T12:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Add-In:  How to load spatial SQL Server table to project's active map using C#?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133849#M7612</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to create featurelayer you can find in &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring#create-featurelayer-and-add-to-map-using-layercreationparams" target="_self"&gt;ArcGIS Pro SDK Snippets&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string url = @"E:\WorkingFolder\MyAddIn\GISTMPConnection.sde\ApexSwatCompare_layer";
Uri uri = new Uri(url);
await QueuedTask.Run(() =&amp;gt; LayerFactory.Instance.CreateLayer(uri, MapView.Active.Map));&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:25:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133849#M7612</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-01-14T14:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Add-In:  How to load spatial SQL Server table to project's active map using C#?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133970#M7615</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; I encountered "two-step" errors:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; First, my connections string for the sde was wrong.&amp;nbsp; The correct one was (I renamed the table fearing I was encountering character limit in my name):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;string url = @"E:\WorkingFolder\SWATAddIn\MGConnection.sde\MG.dbo.AxSwCompare";&lt;BR /&gt;&lt;BR /&gt;The dot-dbo notation should be specified:&amp;nbsp; "\databaseName.dbo.tableName".&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Next, the table in sde geodatabase didn't have OBJECTIDs, so ArcGIS Pro was throwing an exception.&amp;nbsp; I have to modify the SQL Server table to add OBJECTIDs as IDENTITY-type.&lt;/P&gt;&lt;P&gt;It was able to load the shapefile after I did the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the link.&amp;nbsp; It was very helpful.&amp;nbsp; I couldn't have found them on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 17:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-add-in-how-to-load-spatial-sql-server/m-p/1133970#M7615</guid>
      <dc:creator>JadedEarth</dc:creator>
      <dc:date>2022-01-14T17:45:57Z</dc:date>
    </item>
  </channel>
</rss>

