SqlConnection scon = new SqlConnection("database=StudentDB;trusted_connection=yes");
SqlCommand scmd = new SqlCommand("select* from StudentInfoTable", scon);
SqlDataAdapter sda = new SqlDataAdapter(scmd);
DataSet ds = new DataSet();
sda.Fill(ds);
TextBox1.Text = ds.Tables[0].Rows[0][0].ToString(); //The Main Line to understand scon.Close();
SqlCommand scmd = new SqlCommand("select* from StudentInfoTable", scon);
SqlDataAdapter sda = new SqlDataAdapter(scmd);
DataSet ds = new DataSet();
sda.Fill(ds);
TextBox1.Text = ds.Tables[0].Rows[0][0].ToString(); //The Main Line to understand scon.Close();
No comments:
Post a Comment