1. Background Method
Public String ID;
Public String usercode;
Public void tbalelist (string strsql)
{
String STR = string. empty;
Dbcon oacon = new dbcon ();
Sqlconnection myconn = new sqlconnection (oacon. getoacon ());
Myconn. open ();
Sqlcommand SC = new sqlcommand (strsql, myconn );
Sqldatareader sr = SC. executereader ();
If (Sr. Read ())
{
Id = Sr [0]. tostring ();
Usercode = Sr [1]. tostring ();
}
Sr. Close ();
Myconn. Close ();
}
2. Front-end
<Table align = "center" border = "0" cellpadding = "5" cellspacing = "1" width = "100%">
<Tr>
<TD class = "hback" width = "5%">
<Font color = "# cc3300"> <B> id </B> </font> </TD>
<TD class = "hback" width = "10%">
<Font color = "# cc3300"> <B> id </B> </font> </TD>
</Tr>
<Tr>
<TD class = "hback" width = "5%"> <% = ID %> </TD>
<TD class = "hback" width = "10%"> <% = usercode %> </TD>
</Tr>
</Table>