Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to connect with sql server database and html5 web application using java Script?
Posted
Updated 16-Jul-14 20:05pm
v3
Comments
W Balboos, GHB 17-Jul-14 11:15am    
I suggest you consider using php to do your database connections.

If not, http://stackoverflow.com/questions/857670/how-to-connect-to-sql-server-database-from-javascript .

Did you try doing a web search for yourself?
W Balboos, GHB 21-Jul-14 7:42am    
To whoever down-voted this answer:

Did you follow the link? SQL/javaScript can be down client-side. I'd never do it, but it can be done (the question, above, thus answered in the link).

If you didn't like that I inquired about the whether a web-search was conducted before posting the question, it's because the answer's so easily gotten that way.

SO - if you've a valid criticism, I'd like to hear and learn. If you didn't check the link (i.e., both answers, below, say cannot with what can be done) or didn't wish to be told to search because you've better things to do and would rather we do it for you, then keep your down-votes to yourself.

Database operations work at server side. You can use JS to interact with server side. That is it.
 
Share this answer
 
JavaScript is for client-side scripting, it cannot connect to the database. However, you can use Ajax to convey client-side request to the server-side scripting like php, jsp, or .net code-bebind, which in turn connect to the database for any database operations, the result of which will be passed back to your Ajax script through the server-side script.
Refer: AJAX Introduction[^]
You can ask Google for more info on Ajax implementation with specific server-side scripting.
 
Share this answer
 
v2

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