How to query Sql Server data from JavaScript
For the following scenario:
A JavaScript client application sends a JSON query to a webservice. Simplified query example:
{
table: "orders",
filter: {
date: "2011-01-25"
}
}
The webservice compiles the request into a SQL query and executes it on SQL Ser开发者_开发问答ver. The webservice returns the result of the query in JSON format.
I need the simplest way (technology stack) to implement the webservice. It should run under Windows Server and IIS 6 and work with SQL Server 2005. I prefer a dynamic language so that the changes in the data definition should not be kept in sync manually.
Check out these two:
- WCF RIA Services
- Dynamic Data Domain Service
It will be easier for you to use jQuery on the client side, because it's able to parse JSON for you. And if you do a search on Google aboout either of them you will find enough resources to get you started.
You will have some more configuration to do on your outdated IIS6 machine, but I suppose it should work just as well. I can't guarantee but check the web. And if at all possible upgrade to IIS7. It's about time you do...
精彩评论