Has anyone had any luck in querying a SQL Server 2008 table that has a GEOGRAPHY column? - Not a GEOMETRY column, a GEOGRAPHY one.
When I set myDataSource, myInitialCatalog, myUserID, and myPassword all to correct values and attempt to open a SQL Server 2008 Geography layer with the following commands
Dim connectString As String = "Data Source=" & myDataSource & _
";Initial Catalog=" & myInitialCatalog & _
";Persist Security Info=True;User ID=" & myUserID & ";Password=" & myPassword & ";"
'test to make sure my connect string is OK
Dim sqlConnection As SqlConnection = New SqlConnection(connectString)
sqlConnection.Open()
If sqlConnection.State <> ConnectionState.Open Then
Exit Sub
End If
sqlConnection.Close()
'try to open a layer
Dim sql2008Layer As MsSql2008FeatureLayer = New MsSql2008FeatureLayer(connectString, "gis.State", "OBJECTID")
sql2008Layer.Open()
I keep getting the exception "Can not find the geometry column." from the sql2008Layer.Open call. I do not have a geometry column in this table, I have a GEOGRAPHY one. I get the same exception if I send in an invalid table name such as "whopper.withcheese" to the call to MsSql2008FeatureLayer, so perhaps the call actually does work and I have an incorrect value somewhere...
I've been told by ThinkGeo support that the GEOGRAPHY type has been supported since 3.0.96. Has anyone been successful in querying such a layer, and if so are there any tricks one needs to do to get it to work?
Below is a screenshot of my gis.State table taken from SQL Server Management Studio, so I don't think I've mistyped the tablename or featureid column parameters in the call to create the layer...