SqlConnection con = new SqlConnection("DatabaseConnectionString"); con.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM Student WHERE ID = " + id, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); foreach(DataRow dr in dt.Rows) { idLbl.Text = dr["Id"].ToString(); nameLbl.Text = dr["Name"].ToString(); classLbl.Text = dr["ClassName"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)