Select to view content in your preferred language

Record a draw to a database

708
4
05-23-2010 12:32 PM
AlexandreGomes
Deactivated User
Hi, I'm pretty new to the API and Silverlight and I'm needing to do an application where users can draw lines to the map loaded via mapserver and stores that lines in SQL Server.

I've already done the map showing and polyline draws, but can't figure out how can I store that lines to the database and load them to the map.

If possible, I'd also like to know how I can do this to other draws like polygon and freehand.


Thanks in advance

Alexandre
0 Kudos
4 Replies
wangzhifang
Frequent Contributor
If you want to save the line in a sqlserver database, you need to be responsible for serialize/deserialize between the coordinates pair and polyline. Sqlserver database can save coordinates pair only.
You need to retrieve the graphic's geometry drawed by draw objects, then cast the geometry to polyline, so you can find the coordinates pair of the points.
0 Kudos
AlexandreGomes
Deactivated User
Hi, thanks for your help.

But I have no idea how I can get this geometry and these coordinates, neither how to send them to database (would be with linq?).

Thanks
0 Kudos
dotMorten_esri
Esri Notable Contributor
v2.0 has this support built in in conjunction with ArcGIS v10. This is by far the easiest way to do it.
If not, take a look at this blogpost: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlig...
0 Kudos
AlexandreGomes
Deactivated User
Just forgot to thank for the answers, I'll try to do the suggestions, and any doubts I'll come back.

Thanks
0 Kudos