public static IWorkspace GDBConnect(string Server, string Instance, string Password, string Database)
{
IPropertySet pPropSet = new PropertySet();
IWorkspaceFactory pSdeFact = new SdeWorkspaceFactory();
IPropertySet with_1 = pPropSet;
with_1.SetProperty("SERVER", Server);
with_1.SetProperty("INSTANCE", Instance);
with_1.SetProperty("DATABASE", Database);
with_1.SetProperty("USER", "SDE");
with_1.SetProperty("PASSWORD", Password);
with_1.SetProperty("VERSION", "SDE.DEFAULT");
try
{
return pSdeFact.Open(pPropSet, 0);
}
catch
{
return null;
}
}
это получаем СДЕ воркспэйс
дальше
pGDBW = GDBConnect(sGDBConnProp[0], sGDBConnProp[1], sGDBConnProp[2], sGDBConnProp[3]);
IFeatureWorkspace pFeatureWRSP = pGDBW as IFeatureWorkspace;
IFeatureClass OutfeatureClass;
OutfeatureClass = pFeatureWRSP.OpenFeatureClass(name);
потом
IDataset pDS = OutfeatureClass.FeatureDataset as IDataset;
IWorkspaceEdit pWKSE = pDS.Workspace as IWorkspaceEdit;
pWKSE.StartEditing(true);
Console.WriteLine("Начало редактирования");
pWKSE.StartEditOperation();
редактируем
pWKSE.StopEditOperation();
pWKSE.StopEditing(true);