In a C# Add-In I can add a SDE style feature class to my map with the following code, this fails when attempting to load a FC contained in a Feature Dataset.
case "SDEFeature":
uri= new Uri(theFullPath.Replace(theSeperator,@\));
t = QueuedTask.Run(() =>
{
try
{
var x = LayerFactory.Instance.CreateLayer(uri, mapView.Map, 0, theShortName);
}
catch (Exception eX)
{
MessageBox.Show("Unable to load the selected dataset. " + eX.Message.ToString(), "Data Load Problem", MessageBoxButtons.OK);
}
});
In the above example theSeperator used in the source is "|".
When using a feature dataset it returns "Unable to load the selected dataset. Failed to create layer from W:\HQsdePoliticalAdminBoundariesP.sde\PoliticalAminBoundaries.DBO.CadastrialFWCountyBndr."
Question, is there a difference when specifying a Feature Class vs. Feature Dataset when using the layer factor? Should I be using a different factory?