asp.net - How can I set a label form database -
i want set label out database.
query:
string strquery = "select * contacts user='" + strselecteduser + "'"; sqlcommand command = new sqlcommand(strquery, global.myconn); sqldataadapter da = new sqldataadapter(command); da.fill(global.ds, "tabel");
now want set label
lblcontact.text=......[column database = name]....?
how do that?
please use blow code set label value database.
first check query retuning value assign value label text
if(global.ds.tables["tabel"].row.count>0) { lblcontact.text=global.ds.tables["tabel"].rows[0]["colomn_name"].tostring(); }
Comments
Post a Comment