Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!

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.

Thanks
Nirbhay
Posted
Updated 6-Feb-13 4:42am
v3
Comments
ZurdoDev 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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900