using jquery to write sql queries?

how to use jquery to write sql queries. consider a webservice call using jquery to asp.net webservice, sending an sql query and getting back the results in json format. but there's a problem with the connection string because it must not be available if a user views the source of the page.

Answers


This is a very, very, very bad idea unless you took a great deal of precaution in filtering what queries were allowed, SQL injection would be wide open to a user.

For example:

DROP Table XXXX;

Aside from that main reason...jQuery won't do anything to help with this, it can assist in whatever UI you're building, but there's nothing inherently present in jQuery to help with what you're after at all.

For the connection string bit: jQuery can't execute SQL queries...your web service would have to execute whatever anyway, so there's no connection string to be seen anyway, it's server-side.


If you're just after examples of how to do this - executing generic SQL - take a look at some project out there. For example the Stack Exchange Data Explorer where you can query StackOverflow data. It's open source, you can view it all right here.


Need Your Help

c# sorting objects in list by contact status and name

c# sorting .net-3.5 instantmessenger

I have a BindingList with objects in which is saved some contacts.

'sys is undefined' error in telerik sitefinity 5.1

javascript jquery telerik sitefinity-5

I'm getting 'sys is undefined' error when I editted a content from a page. In Mozilla, Google Chrome and IE8 works correctly but IE10 doesn't support. I used css3 and html5 attributes in the page. ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.