|
One thing written in the past, a piece of code:
public void table_fill ()
{
SqlConnection conn = new SqlConnection ("data source = fish_in_sky; database = MIS; uid = sa; pwd =");
SqlCommand myCommand = new SqlCommand ();
conn.Open ();
string strsql = "select real name, ID number, address, phone, Email, notes from user_info where username = '" + Request.QueryString ["name"] + "'";
SqlCommand cmd = new SqlCommand (strsql, conn);
SqlDataReader rd = cmd.ExecuteReader ();
if (rd.Read ())
{
TextBox4.Text = rd.GetValue (0) .ToString (). Trim ();
TextBox5.Text = rd.GetValue (1) .ToString (). Trim ();
TextBox6.Text = rd.GetValue (2) .ToString (). Trim ();
TextBox7.Text = rd.GetValue (3) .ToString (). Trim ();
TextBox8.Text = rd.GetValue (4) .ToString (). Trim ();
TextBox9.Text = rd.GetValue (5) .ToString (). Trim ();
}
conn.Close ();
} |
|