"question and code follows":
In have added an html page in asp.net website now my task is ::
i have one button and textarea in design part of html page,i want to display sqlserver table data in textarea control when clicked on button using javascript.please tell me the procedure and javascript code to do this task
i have written some code please look at this code as follows:
sriram chvPosted Jul 25, 2011, 8:04 AM
it is not debugging sir i kept your code only sir i have taken div also in design as it is not coming in plz see my code sir to display in div or textarea and make correction sir thank u sir for ur kind help.
""my code as follows sir"":
function getsql() {
var connection = new ActiveXObject("ADODB.Connection") ;
var connectionstring = "Data Source=xxxxx;Initial Catalog=sriram;User ID=sa;Password=xxxx;Provider=SQLOLEDB";
connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");
rs.Open("select * from studenttable", connection);
alert("get tbl");
rs.MoveFirst
while (!rs.eof) {
var dt = rs.field(0);
alert(dt);
document.getElementById("get").innerHTML = rs.fields(1);
}
}
rs.close;
connection.close;