<?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 SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772645#M695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Øystein,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ave's issue should have been fixed at Pro 2.4. &amp;nbsp;What version of Pro are you using? &amp;nbsp;Could you post a small code snippet about what you are trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2019 15:12:49 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2019-08-06T15:12:49Z</dc:date>
    <item>
      <title>ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772636#M686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;A href="https://community.esri.com/group/1759" target="_blank"&gt;Esri Technical Support&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using ArcGIS Pro SDK for .NET version 2.2.0.12813.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on community sample&amp;nbsp;ChangeLayerDataSource.cs I have implemented Data Source change functionality using SetDataConnection method.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;featureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetDataConnection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;updatedDataConnection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Everything works fine except the cases when WorkspaceFactory changes from FileGDB to SDE or the other way around, from SDE to FileGDB. After setting the new Data Connection, the new parameters are attached to the featureLayer, but when reading the layers again with&amp;nbsp;&lt;SPAN class="" style="color: #24292e; background-color: #ffffff;"&gt;MapView&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #24292e; background-color: #ffffff;"&gt;Active&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #24292e; background-color: #ffffff;"&gt;Map&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #6f42c1; background-color: #ffffff;"&gt;GetLayersAsFlattenedList&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;().&lt;/SPAN&gt;&lt;SPAN class="" style="color: #6f42c1; background-color: #ffffff;"&gt;OfType&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #6f42c1; background-color: #ffffff;"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&amp;gt;(), the&amp;nbsp;featureLayer.GetFeatureClass() shows the old FeatureClass. After closing/saving and reopening the project the FeatureClass is updated and SDK shows it correctly with&amp;nbsp;&lt;SPAN&gt;featureL&lt;/SPAN&gt;&lt;SPAN&gt;ayer.GetFeatureClass().&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;Has anyone had a similar issue and is there a way to&amp;nbsp;refresh FeatureClass programmatically to be used in SDK?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Ave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772636#M686</guid>
      <dc:creator>AveVill</dc:creator>
      <dc:date>2021-12-12T08:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772637#M687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are investigating this situation now. I'll respond again when I have more information to share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 16:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772637#M687</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-03-14T16:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772638#M688</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;Thank you for your response and for looking into the matter!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would just like to add that I carried out additional tests and discovered that the same problem occurs when the WorkspaceFactory does not change. However, when using the method findAndReplaceWorkspacePath, then the FeatureClass is updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is if this is the expected behaviour&amp;nbsp;that FeatureClass is not updated when using SetDataConnection method or is this a bug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2019 10:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772638#M688</guid>
      <dc:creator>AveVill</dc:creator>
      <dc:date>2019-03-15T10:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772639#M689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We think this is a bug, but haven't figured out the cause or how hard it is to fix. &amp;nbsp;Is using findAndReplaceWorkspacePath an acceptable work-around?&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, 15 Mar 2019 14:30:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772639#M689</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-03-15T14:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772640#M690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested different cases with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;findAndReplaceWorkspacePath.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;It works fine with the cases:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;FileGDB -&amp;gt; FileGDB&lt;BR /&gt;SDE -&amp;gt; SDE&lt;BR /&gt;FileGDB -&amp;gt; SDE&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;It fails with the case:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;SDE -&amp;gt; FileGDB&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;Exception thrown: 'ArcGIS.Desktop.Mapping.MappingException' in ArcGIS.Desktop.Mapping.dll
ArcGISPro.exe Warning: 0 : ArcGIS.Desktop.Mapping.MappingException: Error HRESULT E_FAIL has been returned from a call to a COM component. ---&amp;gt; System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
 at ArcGIS.Desktop.Internal.DesktopService._IMapAuthoringService.ReplaceLayerOrStandaloneTableWorkspace(Int32 repositoryID, String mapPath, String layerPath, String toFind, String replaceWith, Boolean validate)
 at ArcGIS.Desktop.Mapping.Layer.&amp;lt;&amp;gt;c__DisplayClass89_0.&amp;lt;FindAndReplaceWorkspacePath&amp;gt;b__0()
 at ArcGIS.Desktop.Internal.Mapping.Utilities.MakeBasicServiceCall(Action serviceCall)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Ave&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772640#M690</guid>
      <dc:creator>AveVill</dc:creator>
      <dc:date>2021-12-12T08:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772641#M691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue should be fixed in Pro 2.4, forthcoming this summer.&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, 29 Mar 2019 15:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772641#M691</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-03-29T15:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772642#M692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 10:42:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772642#M692</guid>
      <dc:creator>AveVill</dc:creator>
      <dc:date>2019-04-09T10:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772643#M693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is fixed in Pro 2.4.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 18:47:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772643#M693</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-06-14T18:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772644#M694</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;I am experiencing the same problem&amp;nbsp; with the SDK as Ave when it comes to F&lt;SPAN style="background-color: #ffffff;"&gt;indAndReplaceWorkspacePath when changing a layers source from&amp;nbsp;&lt;SPAN&gt;SDE -&amp;gt; FileGDB. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN style="color: #b05b06; background-color: #ffffff;"&gt;"Exception thrown: 'ArcGIS.Desktop.Mapping.MappingException' in ArcGIS.Desktop.Mapping.dll&lt;/SPAN&gt;&lt;BR style="color: #b05b06; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #b05b06; background-color: #ffffff;"&gt;ArcGISPro.exe Warning: 0 : ArcGIS.Desktop.Mapping.MappingException: Error HRESULT E_FAIL has been returned from a call to a COM component..."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realize that this is not the main topic of this thread but since it is mentioned here and exactly what I am trying to solve I wanted to hear if you know about this issue and if it is something that will be looked into by Esri?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Øystein&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 11:39:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772644#M694</guid>
      <dc:creator>ØysteinKristoffersen</dc:creator>
      <dc:date>2019-08-06T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772645#M695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Øystein,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ave's issue should have been fixed at Pro 2.4. &amp;nbsp;What version of Pro are you using? &amp;nbsp;Could you post a small code snippet about what you are trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772645#M695</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-08-06T15:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772646#M696</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;I have been testing a bit recently with 2.4.0 and the problem persists for me. Originally I was doing &lt;STRONG&gt;featureLayer&lt;/STRONG&gt;.&lt;SPAN style="background-color: #ffffff;"&gt;F&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;indAndReplaceWorkspacePath, and this throws the&amp;nbsp;&lt;SPAN style="color: #b05b06;"&gt;ArcGIS.Desktop.Mapping.MappingException&lt;/SPAN&gt;&lt;/SPAN&gt; (also in 2.4.0). However I think a more correct way for me is to do a &lt;STRONG&gt;currentMapView&lt;/STRONG&gt;.&lt;SPAN style="background-color: #ffffff;"&gt;F&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;indAndReplaceWorkspacePath. I have implemented this now and an exception is not thrown, however no datasources are switched either. Nothing happens. Also notice that switching from SDE -&amp;gt; SDE is working fine for me. The following code is my current switch source function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private void ChangeSourceByMap(MapView mapView) { Map map = mapView.Map; Geodatabase gdb; GDBProjectItem newgdb; foreach (KeyValuePair&amp;lt;connectionitem, gdbprojectitem=""&amp;gt; datasource in this.uniqueSourceDict) { newgdb = datasource.Value; if (newgdb == null) continue; string workspaceString = datasource.Key.ConnectionString; string suffix = Path.GetExtension(newgdb.Path).ToLower(); if (suffix == ".sde") gdb = new Geodatabase(new DatabaseConnectionFile(new Uri(newgdb.Path))); else gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(newgdb.Path))); map.FindAndReplaceWorkspacePath( workspaceString, gdb.GetConnectionString(), true); } }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Øystein&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 13:50:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772646#M696</guid>
      <dc:creator>ØysteinKristoffersen</dc:creator>
      <dc:date>2019-08-19T13:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK for .NET points to the old FeatureClass after changing Data Source of FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772647#M697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;FindAndReplaceWorkspacePath does not support changing workspace types - FileGDB to SDK and vice versa.&amp;nbsp; Instead, use ReplaceDataSource method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//This is the existing layer for which we want to switch the underlying datasource&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Active&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayersAsFlattenedList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureLayer&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Geodatabase geodatabase &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Geodatabase&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;DatabaseConnectionFile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;@"Full path to SDConnectionFile.sde"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
       &lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Dataset dataset &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geodatabase&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OpenDataset&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureClass&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ArcGIS.DBO.TESTPOINTS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ReplaceDataSource&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dataset&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
       &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-for-net-points-to-the-old/m-p/772647#M697</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-12-12T08:38:45Z</dc:date>
    </item>
  </channel>
</rss>

