AnsweredAssumed Answered

Add a Table from a Geodatabase

Question asked by MannyJohn on Oct 9, 2019
Latest reply on Oct 9, 2019 by MannyJohn

Hello everyone,

protected override void OnClick()
        {
            Geodatabase fileGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"\\dep-gisdev\tidelandsdata\tlprod\Tidelands_Publication.gdb")));
            Table table = fileGeodatabase.OpenDataset<Table>("Composite_Table");
        }

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. 

Attachments

Outcomes