I'm adding support for SDE to an application that currently allows customers to use personal or file geodatabases. If the database doesn't exist, we create it using the ESRI.ArcGIS.Geodatabase.IWorkspaceFactory.Create method.
For a personal geodatabase:
workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactoryClass();
System.IO.FileInfo fInfo = new System.IO.FileInfo("MyDataBase");
workspaceName = workspaceFactory.Create("c:\\Temp\", fInfo.Name, null, 0);
For a file geodatabase:
workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactoryClass();
workspaceName = workspaceFactory.Create("c:\\Temp\", "MyDataBase", null, 0);
Is there a similar method to create an SDE database? I've found code samples to create a spatial database connection but I have to use ArcCatalog to create the geodatabase in order to use the connection. What we want to do is create the geodatabase using C# code. Has anyone done this?
Using ArcGIS10, SQLServer Express 2008, ArcEditor