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 5:32am
Edited 6-Feb-13 5: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 Sergey Alexandrovich Kryukov 424
1 OriginalGriff 375
2 CHill60 230
3 CPallini 220
4 Maciej Los 210
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2015
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