Hello everyone,
<SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">override</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">OnClick</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Geodatabase fileGeodatabase <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Geodatabase</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FileGeodatabaseConnectionPath</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">@"\\dep-gisdev\tidelandsdata\tlprod\Tidelands_Publication.gdb"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
Table table <SPAN class="operator token">=</SPAN> fileGeodatabase<SPAN class="punctuation token">.</SPAN>OpenDataset<SPAN class="operator token"><</SPAN>Table<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Composite_Table"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I'm having trouble with C# code for ArcGIS Pro which will add a Table stored on a local Geodatabase in the Table of Contents for ArcGIS Pro. i was able to create some part of the code, but i'm getting an Exception Unhanded Error from Visual Studio stating : ArcGIS.Core.ConstructedOnWrongThreadException: 'This object must be created within the lambda passed to QueuedTask.Run, or on a compatible Sta thread'. I'm using a simple button to execute this code OnClick.