Opening an SDE Direct Connection to SQL Server

2031
1
06-26-2013 08:27 AM
DavidWilcox
New Contributor II
Hi All,

I just upgraded to ArcGIS Server 10.1 and I'm trying to work without any sde application code on the server. However, I haven't been able to establish a direct connection from the client using ArcObjects. Is there a new interface or a new parameter I need to set? The instance just seems to take me over to the services file. Here's a code snip:

    Public Shared Function openSDEWorkspace(ByVal pServer As String, _
         ByVal pInstance As String, ByVal pDatabase As String, ByVal pUser As String, _
         ByVal pPassword As String, ByVal pVersionName As String) As Geodatabase.IWorkspace
        Try
            Dim pSDEWorkspaceFactory As Geodatabase.IWorkspaceFactory = New DataSourcesGDB.SdeWorkspaceFactory
            Dim pPropertyset As esriSystem.IPropertySet = New esriSystem.PropertySet
            With pPropertyset
                .SetProperty("Server", pServer)
                .SetProperty("Instance", pInstance)
                .SetProperty("Database", pDatabase)
                .SetProperty("user", pUser)
                .SetProperty("password", pPassword)
                .SetProperty("version", pVersionName)
            End With
            Dim pWorkspace As Geodatabase.IWorkspace = pSDEWorkspaceFactory.Open(pPropertyset, 0)



Thanks for any ideas!

- Dave Wilcox
VIMS, College of W&M
0 Kudos
1 Reply
DavidWilcox
New Contributor II
I think I've figured it out. An instance of "sde:sqlserver:[serverinstance]" seems to work.- Dave

Hi All,

I just upgraded to ArcGIS Server 10.1 and I'm trying to work without any sde application code on the server. However, I haven't been able to establish a direct connection from the client using ArcObjects. Is there a new interface or a new parameter I need to set? The instance just seems to take me over to the services file. Here's a code snip:

    Public Shared Function openSDEWorkspace(ByVal pServer As String, _
         ByVal pInstance As String, ByVal pDatabase As String, ByVal pUser As String, _
         ByVal pPassword As String, ByVal pVersionName As String) As Geodatabase.IWorkspace
        Try
            Dim pSDEWorkspaceFactory As Geodatabase.IWorkspaceFactory = New DataSourcesGDB.SdeWorkspaceFactory
            Dim pPropertyset As esriSystem.IPropertySet = New esriSystem.PropertySet
            With pPropertyset
                .SetProperty("Server", pServer)
                .SetProperty("Instance", pInstance)
                .SetProperty("Database", pDatabase)
                .SetProperty("user", pUser)
                .SetProperty("password", pPassword)
                .SetProperty("version", pVersionName)
            End With
            Dim pWorkspace As Geodatabase.IWorkspace = pSDEWorkspaceFactory.Open(pPropertyset, 0)



Thanks for any ideas!

- Dave Wilcox
VIMS, College of W&M
0 Kudos