Connecting to ArcSDE 10.2.1 using ArcObjects

3730
2
03-09-2014 09:04 PM
VikramS
Occasional Contributor
Hello all,

I developed a standalone application using Arcobjects 10.1 . I used property set to open the workspace as shown below

                IPropertySet propertySet = new PropertySetClass();
                propertySet.SetProperty("SERVER", server);
                propertySet.SetProperty("INSTANCE", instance);
                propertySet.SetProperty("DATABASE", db);
                propertySet.SetProperty("USER", user);
                propertySet.SetProperty("PASSWORD", password);
                propertySet.SetProperty("VERSION", version);


                Type factoryType = Type.GetTypeFromProgID(
                    "esriDataSourcesGDB.SdeWorkspaceFactory");
                IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
               (factoryType);
                pWorkspace = workspaceFactory.Open(propertySet, 0);

Now we have upgraded the arcsde to 10.2 . SQL Server 2012 has default instance . Now I am getting error saying "entry for sde instance not found in services file"

Is there a way to connect SDE using direct connect ? How to create ArcSDE Service ?

Thanks
0 Kudos
2 Replies
BrentHoskisson
Occasional Contributor III
What error are you getting?  There are two different ways to direct connect that I have found that works.

You can use
propertySet.SetProperty("USER", "\");
propertySet.SetProperty("PASSWORD", "\");


Or you can use
propertySet.SetProperty("AUTHENTICATION_MODE", "OSA");


Good Luck
0 Kudos
BrentHoskisson
Occasional Contributor III
What error are you getting?  What are the values of your variables?  Direct connect hasn't changed that I know of.

IPropertySet propertySet = new PropertySetClass();
propertySet.SetProperty("SERVER", server);
propertySet.SetProperty("INSTANCE", "sde:<db type>:" + server);  <db type> is like "sqlserver"
propertySet.SetProperty("DATABASE", db);
propertySet.SetProperty("VERSION", "dbo.Default");

and either
propertySet.SetProperty("USER", user);
propertySet.SetProperty("PASSWORD", password);

or 
propertySet.SetProperty("AUTHENTICATION_MODE", "OSA");

0 Kudos