private void Form2_Load(object sender, EventArgs e) { string sql = "select * from Student"; SQLConn db = new SQLConn(); dt = db.selectData(sql); dataGridView1.DataSource = dt; }
private void Delete_Load(object sender, EventArgs e) { string sql = "select * from Student"; SQLConn db = new SQLConn(); DataTable dt = new DataTable(); dt = db.selectData(sql); comboBox1.DataSource = dt; comboBox1.DisplayMember = "ID"; }
private void Form3_Load(object sender, EventArgs e) { string sql = "select * from Student"; SQLConn db = new SQLConn(); DataTable dt = new DataTable(); dt = db.selectData(sql); comboBox1.DataSource = dt; comboBox1.DisplayMember = "ID"; textBox1.DataBindings.Add("Text", dt, "firstName"); }