Here is my scenario:
- User enters in address
- Address is geolocated
- Geolocation is buffered (1 ft)
- Graphic returned is used in query feature to get a road ID
All the above is pretty straight forward ESRI JavaScript API – now I am hitting a bit of a crossroads in approaches and I am wondering if you have an approach you use for the following:
I have the road segment ID in a variable on the client side in JavaScript. I need this ID to query a database table in sql server.
The query is pretty simple
SELECT Library FROM DataTable WHERE Road_ID = x
It is just a database table not geodatabase. The returned data will only be one record and one attribute - the closest Library. I will use the returned data to continue on in the JavaScript API.
So I have an idea of how to proceed but I am not sure it is the smartest way to go. My tool set is ASP.NET, C#, Dojo, ESRI JavaScript API and JavaScript:
- Connection string to the database goes in web.config
- JavaScript will have to interact with C# function
- C# function should be on the “code behind page” of an aspx page.
- I think I need to implement a Client Callback without Post Backs as outlined in this article http://msdn.microsoft.com/en-us/library/ms178208.aspx
- Then I can use the callback data returned to move on my happy way with the JavaScript API on the client side again.