I am going to save a polygon that is created from points to remote geodatabase. I am new with ArcObjects and can't understand how it works... at this point I want to open a connection to database using ArcObjects and save geometry in it. I am using this code:
public IWorkspace open_ArcSDE_Workspace(string server, string instance, string user,
string password, string database, string version)
{
// Create the workspace factory.
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SqlWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
(factoryType);
// Create the connection properties.
IPropertySet connectionProps = new PropertySetClass();
connectionProps.SetProperty("dbclient", server);
connectionProps.SetProperty("serverinstance", instance);
connectionProps.SetProperty("authentication_mode", "OSA");//The type of authentication to use. Valid values are DBMS and operating systems authentication (OSA). DBMS is the default mode and is not required.
connectionProps.SetProperty("user", user);
connectionProps.SetProperty("password", password);
// Open the workspace.
//IWorkspace workspace = workspaceFactory.Open(connectionProps, 0);
return workspaceFactory.Open(connectionProps, 0);
}
But it throws errors:
enter code hereError HRESULT E_FAIL has been returned from a call to a COM component.
Can you help me and give me some examples that I can understand... The only source I have found for ArcObjects is ESRI and I couldn't find ant solutions for it.