Refer to ".NET Help for VS2005" ,I get the code as follows:
public IWorkspace OpenArcSDEWorkspace(string server, string instance, string user,
string password, string database, string version)
...{
ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();
propertySet.SetProperty("SERVER", server);
propertySet.SetProperty("INSTANCE", instance);
propertySet.SetProperty("DATABASE", database);
propertySet.SetProperty("USER", user);
propertySet.SetProperty("PASSWORD", password);
propertySet.SetProperty("VERSION", version);
IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();
return workspaceFactory.Open(propertySet, 0);
}
also you can use the ArcCatalog to test the connection,and i will use the ArcCatalog 9.2 as an example to illustrate.
first ,start up the ArcCatalog 9.2 as image 1 shows.

image 1
Double click the "Add Spatial Database Connection" then a dialog display on current page,configure the parameter as image 2 shows:

image 2
ArcSDE连接
本文介绍了一种使用.NET环境下的ArcGIS API连接ArcSDE地理数据库的方法,并提供了具体的代码实现。此外,还通过ArcCatalog 9.2进行了连接测试。
1585

被折叠的 条评论
为什么被折叠?



