"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:
Suthish NairRank #92 · 22.8K reputationPosted Jul 24, 2011, 11:53 PM EDT
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Jul 25, 2011, 12:37 AM EDT
sriram chv35 reputationPosted Jul 25, 2011, 12:57 AM EDT
the above question and code which i asked was my task i have to do that in that manner only i want to get sqlserver table in textarea of html page when clicked on button please do kindly send me code
thanking you,
sriram chv.
sriram chv35 reputationPosted Jul 25, 2011, 12:59 AM EDT
the above question and code which i asked was my task i have to do that in that manner only i want to get sqlserver table in textarea of html page when clicked on button please do kindly send me code
thanking you,
sriram chv.
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Jul 25, 2011, 1:11 AM EDT
sriram chv35 reputationPosted Jul 25, 2011, 4:04 AM EDT
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;