private void Form1_Load(object sender, System.EventArgs e) { string connString = "server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI"; string SQL = @"select * from employee"; SqlConnection Conn = new SqlConnection(connString); SqlDataAdapter da = new SqlDataAdapter(SQL, Conn); da.Fill(dataSet1, "employee"); // Bind the Label's Text property to the ProductID of the Products table label1.DataBindings.Add("Text", dataSet1, "employee.ID"); // Bind the second label's Text property to the UnitPrice column label2.DataBindings.Add("Text", dataSet1, "employee.firstname"); }
Thanks Karthik www.f5Debug.net
Login to post response