<?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: change layer dataSources in ArcGIS Pro SDK.Net in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145141#M7798</link>
    <description>&lt;P&gt;For example, when I run the above code, it searches DBMS for the name 'NEW_PODS.VCAP.ROUTENAME'.&lt;/P&gt;&lt;P&gt;Instead, in the database, it's by the name 'NEW_PODS.ASSET.ROUTENAME,' and that's the reason I'm getting the DBMS table not found error.&lt;/P&gt;&lt;P&gt;So according to me its mapping by the Name but is it possible we can do the mapping by its fields name or by any other attributes?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 14:19:06 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-02-17T14:19:06Z</dc:date>
    <item>
      <title>change layer dataSources in ArcGIS Pro SDK.Net</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145052#M7794</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two layers where I need to change the dataSources using buttonClick. I'm currently using the code below, but I'm unable to change the dataSource of one of the layers because the SDE database does not contain the feature class with that name.&lt;/P&gt;&lt;P&gt;I'm using &lt;STRONG&gt;"&amp;nbsp;Dataset = featureLayer.Name.Split('.').ToList().Last()"&amp;nbsp;&lt;/STRONG&gt;where it is looking for the exact name, but I need to match the data by its field rather than by its name Is there a way to do this, and if so, could someone please provide a code snippet?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*********Code snippet********&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;return QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;CIMDataConnection currentDataConnection = featureLayer.GetDataConnection();&lt;/P&gt;&lt;P&gt;string connection = System.IO.Path.GetFullPath(catalogPath);&lt;BR /&gt;string suffix = System.IO.Path.GetExtension(connection).ToLower();&lt;/P&gt;&lt;P&gt;var workspaceConnectionString = string.Empty;&lt;BR /&gt;WorkspaceFactory wf = WorkspaceFactory.FileGDB;&lt;/P&gt;&lt;P&gt;if (suffix == ".sde")&lt;BR /&gt;{&lt;BR /&gt;wf = WorkspaceFactory.SDE;&lt;BR /&gt;var dbGdbConnection = new DatabaseConnectionFile(new Uri(connection, UriKind.Absolute));&lt;BR /&gt;workspaceConnectionString = new Geodatabase(dbGdbConnection).GetConnectionString();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CIMStandardDataConnection updatedDataConnection = new CIMStandardDataConnection()&lt;BR /&gt;{&lt;BR /&gt;WorkspaceConnectionString = workspaceConnectionString,&lt;BR /&gt;WorkspaceFactory = wf,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DatasetType = esriDatasetType.esriDTFeatureClass,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Dataset = featureLayer.Name.Split('.').ToList().Last()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;***************************&lt;/P&gt;&lt;P&gt;Error which I'm getting because of Name&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ShabinaBano_0-1645107021392.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34233i4CC4F3C59404A86C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ShabinaBano_0-1645107021392.png" alt="ShabinaBano_0-1645107021392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 14:10:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145052#M7794</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-02-17T14:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: change layer dataSources in ArcGIS Pro SDK.Net</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145120#M7797</link>
      <description>&lt;P&gt;Can you give me an example of what you mean by "&lt;SPAN&gt;I need to match the data by its field rather than by its name"?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 13:34:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145120#M7797</guid>
      <dc:creator>KimberlyGarbade</dc:creator>
      <dc:date>2022-02-17T13:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: change layer dataSources in ArcGIS Pro SDK.Net</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145141#M7798</link>
      <description>&lt;P&gt;For example, when I run the above code, it searches DBMS for the name 'NEW_PODS.VCAP.ROUTENAME'.&lt;/P&gt;&lt;P&gt;Instead, in the database, it's by the name 'NEW_PODS.ASSET.ROUTENAME,' and that's the reason I'm getting the DBMS table not found error.&lt;/P&gt;&lt;P&gt;So according to me its mapping by the Name but is it possible we can do the mapping by its fields name or by any other attributes?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 14:19:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-layer-datasources-in-arcgis-pro-sdk-net/m-p/1145141#M7798</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-02-17T14:19:06Z</dc:date>
    </item>
  </channel>
</rss>

