//http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/004t8000000 //Creating a geodatabase in personal or workgroup ArcSDE // dataServerName parameter should be in "<machine_name>\\<sql_instance>" format. public static void CreatePersonalOrWorkgroupArcSdeWorkspace(String dataServerName) { // Create a data server manager object. IDataServerManager dataServerManager = new DataServerManagerClass(); // Set the server name and connect to the server. dataServerManager.ServerName = dataServerName; dataServerManager.Connect(); // Cast to the admin interface, check permissions, and create the geodatabase. IDataServerManagerAdmin dataServerManagerAdmin = (IDataServerManagerAdmin)daManager; if (dataServerManagerAdmin.IsConnectedUserAdministrator) { dataServerManagerAdmin.CreateGeodatabase("LandUse", @"C:\Program Files\M SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\\LandUse.mdf", 0, "", 0); // Create a Name object to open the workspace. IWorkspaceName workspaceName = dataServerManagerAdmin.CreateWorkspaceNamse", "VERSION", "dbo.Default"); IName name = (IName)workspaceName; IWorkspace workspace = (IWorkspace)name.Open(); }
ジオデータベースの作成
2016/9/1 (木)