Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 6-Feb-13 4:32am
Edited 6-Feb-13 4:42am
v3
Comments
ryanb31 at 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 at 6-Feb-13 11:07am
   
Are you using your Connection String in the javascript?

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 278
1 Maciej Los 205
2 Nguyen.H.H.Dang 190
3 arvind mepani 187
4 Peter Leow 180


Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid