Engine Application Not Loading Layers from SDE 10.1 Server

589
4
Jump to solution
08-30-2012 02:51 PM
MichaelTodd
New Contributor II
I have an ArcGIS application that works great when loading layers from SDE 10.0 but fails when trying to load the layers when they're pointing to a SDE 10.1 server.

The only difference is the layer source in the MXD. When the layer points to the SDE 10.0 server, everything loads as expected. If I change the layer source to point to the exact same layer (name, rows, etc.; it was merely copied over from 10.0 to 10.1) in the SDE 10.1 server, a red exclamation point appears next to the layer name.

    The SDE 10.1 layers are visible in ArcMap so this shouldn't be a port or instance issue
    This isn't a licensing issue; I have the app set to exit if the license is invalid/unavailable

Is there something special I need to do to get an Engine application to communicate with an SDE 10.1 server?

Is this a service file issue? I tried adding a reference to the service name and port for the new server in the services file but it didn't seem to help, but 10.0 and 10.1 seem to do services/instances a little differently; perhaps I'm missing something.

UPDATE: The more I think about this, the more it seems to be a "direct connect" issue. Is it possible that I'm not connecting to SDE because things aren't set up right on the client? If so, how do I set up direct connect on an ArcGIS Engine client?
0 Kudos
1 Solution

Accepted Solutions
MichaelTodd
New Contributor II
It turned out that we needed to install the SQL Server Native Client so that our application could communicate with SDE 10.1 via a direct connection.

Since we are using SQL Server 2012, we downloaded the native client from the SQL Server 2012 Feature pack located here https://www.microsoft.com/en-us/download/details.aspx?id=29065. Once the native client was installed, the application was able to load layers from SDE 10.1

View solution in original post

0 Kudos
4 Replies
ScottKutz
New Contributor II
Michael,

  I'm not sure if this is directly related to the issue you are facing, but the following link describes a database connection issue we encountered in the transition from ArcGIS 10.0 to 10.1 with an ArcEngine-based application. In our case, the connection is made as part of defining a Query Layer.

http://forums.arcgis.com/threads/61318-Load-Query-Layer-via-AddLayerFromFile()-difference-ArcGIS-10....

At first we thought there might have been a change in AddLayerFromFile(), but it turned out to be an apparent change in Esri's philosophy on how connections are to be made to databases.

One gets the impression that, starting with ArcGIS 10.1, Esri wants applications to always use the SdeWorkspaceFactory class when establishing a connection, whether the connection is for a geodatabase or not (such as when creating a connection for Query Layers).

In our case, we were able to avoid the "prompt for credentials" in our ArcEngine-based application by making the following changes to our code that creates the connection and eventually obtains a ISqlWorkspace interface pointer that is used to create the Query Class that forms the basis for creating a Query Layer:
- Replace use of the SqlWorkspaceFactory with the SdeWorkspaceFactory class.
- In the PropertySet of connection properties, replace the SERVERINSTANCE property (from ArcGIS 10.0) with the DB_CONNECTION_PROPERTIES property (apparently, this is a new property at the ArcGIS 10.1 level).

If your connection code is currently using the SERVERINSTANCE property, perhaps it will be necessary to change it to the  DB_CONNECTION_PROPERTIES property. (We found it difficult to locate documentation on DB_CONNECTION_PROPERTIES, but it did show up in one of the Esri developer samples.)

  I hope this information is of some use.

Scott
0 Kudos
MichaelTodd
New Contributor II
Unfortunately I'm not connecting to SDE that way (though I may try it if nothing else works).

We have always used an MXD to connect to our layers, then loaded the MXD via LoadMxFile into the application. The MXDs I am using works correctly when connecting to SDE 10.0 but do not work when connecting to SDE 10.1 when using our application. However, both MXDs work in ArcMap, so I know there's nothing wrong with the connection per se, just that there's something wrong when I try to connect via ArcGIS Engine.

Any other thoughts?
0 Kudos
ScottKutz
New Contributor II
Michael,

  Unfortunately, our application only uses ArcGIS Engine (just loading individual layers into the MapControl, not saving or interacting with any MXD files), so we don't have any experience with ArcMap or MXD files. As a result, I don't have any other thoughts to pass along.

  As noted in the forum entry I referenced in my earlier posting, it does seem that Esri has made some changes to the way database connections function in ArcGIS 10.1 (at least, for Query Layers).

  Perhaps there is also some difference for the work flow being used in your application.

  Sorry I could not provide any better information.

Scott
0 Kudos
MichaelTodd
New Contributor II
It turned out that we needed to install the SQL Server Native Client so that our application could communicate with SDE 10.1 via a direct connection.

Since we are using SQL Server 2012, we downloaded the native client from the SQL Server 2012 Feature pack located here https://www.microsoft.com/en-us/download/details.aspx?id=29065. Once the native client was installed, the application was able to load layers from SDE 10.1

View solution in original post

0 Kudos