sapaplanus

How to create query layer based upon SQL Server Spatial and display it on map cntrl

Discussion created by sapaplanus on May 11, 2012
I am stumped.  I have a sql server database, and I have a table with valid geometry fields.   I am able to define the ISqlWorkspace, and build the IQueryDescription  by doing a "select * from maptable" (and I have tried specifiying manually the fields, no change.   I am able to retrieve the column names and values via the SqlWorkspace.GetColumns() call.   But when I try to take this queryDescription and SqlWorkspace, I am unable to cast it to a featureclass.  Is there any samples or tutorials or ideas on how to make the MapControl to display a table with Sql Server 2008 R2 Spatial's geometry column in c# or vb.net?   Any help would be appreciated.

Steve

Outcomes