Click here to Skip to main content
13,151,141 members (41,892 online)
Rate this:
Please Sign up or sign in to vote.

Can any body guide me the procedue to connect a MS Sql Server database using javascript I am using C#3.5 and want to retrive the data through a stored procedure.

I was trying to use a 'javascript gridview' with dropdown boxes where i want to populate the data in dropdown box on every new line creation of a gridview.

ADO Connection is Working but it shows a warning message i.e. 'This website uses a data provider that may be unsafe'. Also I am not sure how much would it be reliable as per today's web project. So please. Other popular connection method can also be helpful. Like Sqlconnection in .net.

Please Help.

Posted 6-Feb-13 4:32am
Updated 6-Feb-13 4:42am
ryanb31 6-Feb-13 11:05am
One way is to create a webservice that does your database work. Then use jQuery's ajax() to call that webservice.
Irbaz Haider Hashmi 6-Feb-13 11:07am
Are you using your Connection String in the javascript?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Database will be on server side. In order to talk to database, you need to communicate from client side to server side.

There are few ways to interact with server side through client side(Javascript):
1. XMLHttpRequest[^]
2. Callback[^]
3. WebService call[^]
4. PageMethod[^]

Try that you find fit.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170924.2 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100