mohamed.bakri

Help in Connecting to SDE in Arc Server 10.1

Discussion created by mohamed.bakri on Oct 29, 2012
I have windows 7 64bit and Arc GIS 10.1 (desktop, server) installed , I???m trying to connect to SDE throw oracle Service (I have Oracle 11g installed) Via this code in windows Applcation :

public static IWorkspace OpenSDEConnection(string ServerName, string UserName, string Password,
                                                 string Instance, string Version, string Database)
        {

            IWorkspace SDEWorkspace = null;
            IWorkspaceFactory pSDEWorkspaceFactory = null;
            IPropertySet pPropset = null;
            try
            {
               
                //Prepare the Sde Connection properties
                pSDEWorkspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactory();
                pPropset = new PropertySet();
                pPropset.SetProperty("ServerName", ServerName);
                pPropset.SetProperty("user", UserName);
                pPropset.SetProperty("password", Password);
                pPropset.SetProperty("Instance", Instance);
                pPropset.SetProperty("version", Version);
                      
                //Opens the workspace specified by the connection properties
                SDEWorkspace = pSDEWorkspaceFactory.Open(pPropset, 0);
                //Success Flag
                return SDEWorkspace;

            }
            catch (Exception)
            {
                return null;
                throw;
            }

        }
But I faced this error  ???Cannot connect to database because the database client software failed to load.  Be sure the database client software is installed and configured correctly.???

Kindly help me in solving this issue ASAP.

Notes:
1. I connected via Arc Catalog and connection succeeded
2. I  Connected Via Oracle TOAD and connection succeeded
3. License initialization succeeded before this step.
4. Windows application built for 64bit.
I connected to Database Through Entity Framework and ODAC and connection Succeeded.

Outcomes