ArcSDE:C#打开SDE数据库的几种方式总结
时间:2021-07-01 10:21:17
帮助过:22人阅读
1.通过指定连接属性参数打开数据库
[csharp] view plain
copy print?
- public IWorkspace OpenSdeWorkspaceByPropertySet(string server, string instance, string user, string password, string database, string version)
- {
- IPropertySet Propset = new PropertySetClass();
- Propset.SetProperty("SERVER", server);
- Propset.SetProperty("INSTANCE", instance);
- Propset.SetProperty("USER", user);
- Propset.SetProperty("PASSWORD", password);
- Propset.SetProperty("DATABASE", password);
- Propset.SetProperty("VERSION", version);
-
- IWorkspaceFactory workspaceFactory = new SdeWorkspaceFactoryClass();
- return workspaceFactory.Open(Propset, 0);
- }
2.通过连接字符串打开数据库
[csharp] view plain
copy print?
- public IWorkspace OpenSdeWorkspaceByConnectionString(string connectionString)
- {
- IWorkspaceFactory2 workspaceFactory = new SdeWorkspaceFactoryClass();
- return workspaceFactory.OpenFromString(connectionString, 0);
- }
3.通过sde文件打开数据库
[csharp] view plain
copy print?
- public IWorkspace OpenSdeWorkspaceFromFile(string connectionFile)
- {
- IWorkspaceFactory workspaceFactory = new SdeWorkspaceFactoryClass();
- return workspaceFactory.OpenFromFile(connectionFile, 0);
- }
ArcSDE:C#打开SDE数据库的几种方式总结
标签:csdn return mysq edit 服务器 ops tail start server