I'm trying to add a feature class to my Active Map from an SDE geodatabase connection. My code is as follows inside a button-click event:
string url = @"E:\WorkingFolder\SWATAddIn\GIS_TMP_Connection.sde\MG.dbo.APEX_SWAT_COMP_HUC8";
Uri uri = new Uri(url);
await QueuedTask.Run(() => LayerFactory.Instance.CreateLayer(uri, MapView.Active.Map));
However, it doesn't load and the error says it's unable to add data (doesn't explain why). If I remove the "MG.dbo." notation before the feature class name, it flags, "Data is not suppported."
What am I doing wrong?
Appreciate any help.