Select to view content in your preferred language

GeoFields

872
2
12-17-2010 08:58 AM
JustinCossentine
Emerging Contributor
Hi,

I'm new to ESRI Silverlight and MapIt spatial data services.  I have read the following link:
http://blogs.esri.com/Dev/blogs/mapit/archive/2009/12/10/Access-geographic-data-in-SQL-Server-withou...

I have my system setup as described but I am not sure how to consume the GeoFields using the Silverlight API.  I want to display shape points on my map.

            var myQueryTask = new QueryTask("http://")
                                      {DisableClientCaching = true};
            var myQuery = new Query
                                    {
                                        ReturnGeometry = true,
                                        OutSpatialReferenceWKID = MyMap.SpatialReference.WKID
                                    };
            myQuery .OutFields.AddRange(new[] { "Lat", "Long });
            myQuery .Where = "1=1";
            myQueryTask .ExecuteCompleted += myQueryTaskExecuteCompleted;
            myQueryTask .Failed += myQueryTaskFailed;
            myQueryTask .ExecuteAsync(myQuery );

Thanks in advance.
0 Kudos
2 Replies
ChrisBradberry
Deactivated User
Look into the query layer -- new in server 10.0.  It allows you to access non-esri data, and make it into a layer that you can use to create a service.  Then just add the service.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s50000000n000000.htm
0 Kudos
JustinCossentine
Emerging Contributor
Got it. Problem was I stll had a geography spatial data field in my table. As soon as I dropped the geog column the geofields return a point.
0 Kudos