0

I have a bunch of location data (longitude and latitude pairs) sitting in a Microsoft SQL Server DB.

I need to plot those points on a Map (OpenLayers+OSM), and the only way to draw on the map is to use JavaScript.

So far, I have no idea how to achieve this goal. The only thing I know is that I do not want to establish a database connection in JavaScript. In other words, I need to somehow use c# to pass the data from database to Javascript. Any suggestions? All help is appreciated!

1
  • Ajax. You expose a HTTP service (WCF?) from .NET land that returns data from MSSQL and then talk to that service using ajax Commented Sep 22, 2011 at 21:26

2 Answers 2

2

Write a asp.net generic handler page that fetches the data from the database and outputs a json string.

Then with jQuery parse that output and plot.

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer combined with tugberk's give me a general direction to the problem. Thanks!
2

You can make use of WebMethods and JQuery here.

Following blog post with an example should give you an idea how you can easily reach the server side code from client side :

http://tugberkugurlu.com/archive/asp-net-web-forms---calling-web-service-page-methods-using-jquery

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.