<pre lang="xml"><!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Database Connect</title> <script type="text/javascript"> function loadDB(){ var connection = new ActiveXObject("ADODB.Connection"); var connectionstring="Data Source=(LocalDB)\v11.0;Initial Catalog=C:\\Program Files\\Microsoft SQL Server\\MSSQL11.SQLEXPRESS\\MSSQL\\DATA\\demo;User ID=GAURAV\GAMER's;Password=\"\";Provider=SQLOLEDB"; connection.open(connectionstring); var rs = new ActiveXObject("ADODB.Recordset"); rs.Open("SELECT demo_name FROM tbl_demo", connection); rs.MoveFirst(); while(!rs.eof) { document.write(rs.fields(1)); rs.MoveNext(); } rs.close(); connection.close(); } </script> </head> <body onload="loadDB()"> <div id="main"></div> </body> </html>
<script></script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)