DataSet ds = new DataSet(); private void Form1_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection("data source=localhost;initial catalog=univ;integrated security=true"); con.Open(); SqlDataAdapter da = new SqlDataAdapter("select name from students", con); da.Fill(ds, "students"); label1.DataBindings.Add(new Binding("Text", ds, "students.name")); con.Close(); }
label1.Text=ds.Tables[0].Rows[0]["name"].ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)