<?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: Equivalent to Arcpy's updateConnectionProperties in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863216#M4849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can call Map.Redraw once, at the end of the process. &amp;nbsp;Sorry for not stating this earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Map APIs are not my area of speciality, so hopefully this will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you probably want to also walk through the StandAloneTable collection as well as Layers, but it makes sense to get the feature layer portion working first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Sep 2020 14:23:49 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2020-09-16T14:23:49Z</dc:date>
    <item>
      <title>Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863213#M4846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a couple of map panes in ArcGIS Pro where the data source might differ from one occasion to te other. However, the name of the FeatureLayers are constant.&lt;/P&gt;&lt;P&gt;I am trying to adjust the underlaying data source based on user input. Meaning, the user has an OpenItemDialog listening on geodatabases. Plan is to use the retrieved path for the update.&lt;/P&gt;&lt;P&gt;However, I don't succeed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following code snippet the &lt;STRONG&gt;selectedMapAjour&lt;/STRONG&gt; is of type Map&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="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectedMapAjour &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsNullOrEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PathGdbAjour&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;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureLayer layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; selectedMapAjour&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layers&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="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="token function"&gt;GetSetDataConnection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PathGdbAjour&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;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetSetDataConnection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureLayer layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; newGDB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;await&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;
        CIMFeatureLayer def &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetDefinition&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;as&lt;/SPAN&gt; CIMFeatureLayer&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; dcon &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; def&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DataConnection &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; CIMStandardDataConnection&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        dcon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WorkspaceConnectionString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IO&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Combine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newGDB&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetDefinition&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;def&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;/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;The code runs through... only the exclamation mark in the TOC of the map do not disappear. Although, the path set via &lt;STRONG&gt;dcon.WorkspaceConnectionString&lt;/STRONG&gt; is reflected in the properties of the FeatureLayers in the TOC.&lt;/P&gt;&lt;P&gt;Hence, I am not sure if my attempt to alter the data source worked and I am missing some refresh or update call, or if this does not work at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I basically need a C# equivalent of&amp;nbsp;updateConnectionProperties.&lt;/P&gt;&lt;P&gt;Thereafter, I will have to adjust the symbology, so ApplySymbologyFromLayer would be next.&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody has an example for this stuff?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863213#M4846</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2021-12-12T10:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863214#M4847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried calling Map.Redraw(True) after your code above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 03:47:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863214#M4847</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2020-09-16T03:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863216#M4849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can call Map.Redraw once, at the end of the process. &amp;nbsp;Sorry for not stating this earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Map APIs are not my area of speciality, so hopefully this will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you probably want to also walk through the StandAloneTable collection as well as Layers, but it makes sense to get the feature layer portion working first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 14:23:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863216#M4849</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2020-09-16T14:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863217#M4850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, since the Map.Redraw(true) does not solve the issue, do you or one of you colleagues have a suggestion on how to get the data source shift working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 15:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863217#M4850</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2020-09-16T15:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863218#M4851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've asked my&amp;nbsp;colleagues who work on the Map APIs to assist. &amp;nbsp;Sorry I couldn't help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 16:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863218#M4851</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2020-09-16T16:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863219#M4852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Rich! Looking forward to the suggestions of your colleagues, and I am pretty sure, the Map.Redraw is needed in the whole process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2020 06:31:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863219#M4852</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2020-09-17T06:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863220#M4853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich, do you think it's possible your colleagues who work on the Map API could have a look at it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bests Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2020 13:31:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863220#M4853</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2020-09-21T13:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863221#M4854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/6130" target="_blank"&gt;Thomas Becker&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I used the following code snippet to change the data source for my feature layers:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ChangeDatasource&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureLayer featLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; newGDB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;await&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="comment token"&gt;// provide a replacement data connection object&lt;/SPAN&gt;
			CIMDataConnection updatedDataConnection &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;CIMStandardDataConnection&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;
				WorkspaceConnectionString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $&lt;SPAN class="string token"&gt;"DATABASE={newGDB}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
				WorkspaceFactory &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; WorkspaceFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FileGDB&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
				DatasetType &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; esriDatasetType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;esriDTFeatureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
				Dataset &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// the updated Data connection should look like this:&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// CustomWorkspaceFactoryCLSID: null&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// Dataset: "TestMultiPoints"&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// DatasetType: esriDTFeatureClass&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// WorkspaceConnectionString: "DATABASE=C:\\Data\\FeatureTest\\FeatureTest.gdb"&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// WorkspaceFactory: FileGDB&lt;/SPAN&gt;

			&lt;SPAN class="comment token"&gt;// overwrite the data connection&lt;/SPAN&gt;
			featLayer&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="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;/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;In my tests (using 2.6) I didn't need to refresh the map view, the content of my replacement data was immediately displayed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863221#M4854</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T10:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863222#M4855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot &lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;‌! Your lines did it.&lt;BR /&gt;Adjusting the value assignment to WorkspaceConnectionString = $"DATABASE={newGDB}" was already enough, but I will stick to line 9 and 10 of your example as well.&lt;BR /&gt;&lt;BR /&gt;Best regards Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2020 08:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863222#M4855</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2020-09-22T08:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Arcpy's updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863215#M4848</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 did not call Map.Redraw, but I have now...&lt;/P&gt;&lt;P&gt;Since Map.Redraw is called on the MapView object I had to switch from the Map object to MapView.&lt;/P&gt;&lt;P&gt;Hence, &lt;STRONG&gt;selectedMapAjour&lt;/STRONG&gt; is now of type MapView.&lt;/P&gt;&lt;P&gt;The code look now as follows:&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="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectedMapAjour &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsNullOrEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PathGdbAjour&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;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureLayer layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; selectedMapAjour&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layers&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="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="token function"&gt;GetSetDataConnection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectedMapAjour&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PathGdbAjour&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;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetSetDataConnection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapView mapview&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FeatureLayer layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; newGDB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;await&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;
        CIMFeatureLayer def &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetDefinition&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;as&lt;/SPAN&gt; CIMFeatureLayer&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; dcon &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; def&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DataConnection &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; CIMStandardDataConnection&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        dcon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WorkspaceConnectionString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IO&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Combine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newGDB&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        dcon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Dataset &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetDefinition&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;def&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        mapview&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Redraw&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;true&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;/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 style="text-align: center;"&gt;Line 18 does not change the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I adjust the data source for a layer manually, then I have to select the appropriate feature class within the geodatabase. Confirming the 'Change Data Source' dialogue makes the layer properties dialogue flash and thereafter the&amp;nbsp;property for the database contains the path to the database. All other information of the layers data source properties are populated. The property 'Feature Class' does not only&amp;nbsp;have the name of the feature class but also a button, holding information about the 'Object Class ID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run my code, the&amp;nbsp;property for the database&amp;nbsp;in the layer property dialogue is showing the entire path, down to the feature class&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C:\Projects\Support\geo_507474_20200721_12_42.gdb\Bassin&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;property for Feature Class in the dialogue show the name of the feature class (without the button for the 'Object Class ID'), while all other properties only show a 'Not Available'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Putting the redraw into the GetSetDataConnection method means that for every layer the map view will be redrawn. I set the redraw in there because when having it right after line 6 I am told that the redraw method must be called on the thread this object was created. Do I have to set the redraw into the GetSetDataConnection method or can I do this also at a more 'central place' where the map view is only updated once all layers got their new data source.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/equivalent-to-arcpy-s-updateconnectionproperties/m-p/863215#M4848</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2021-12-12T10:42:44Z</dc:date>
    </item>
  </channel>
</rss>

