Message |
Your code Andrew Hayden, might work ok - but I guess the other problems is not with ArcGIS Server (ADF's) but with the ArcObjects api. (Standalone) I've got the same issue as well, trying to write a small console utilg and got the error. The same code works ok if i'm doing it within a command class. (A new menu item within ArcMap). If anybody happens to resolve this, please reply Pasting my code as well. (c#) Got Error "Exception from HRESULT: 0x80040228" |
|
//For example, server = "sde-server". // Database = "P100.mydomain.no" // Instance = "5151". // User = "vtest". // Password = "go". // Version = "SDE.DEFAULT". 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); } IWorkspace pWorkspace = OpenArcSDEWorkspace("sde-server", "5151", "myadm", "myadmpassword", "P100.mydomain.com", "SDE.DEFAULT"); |