示例#1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            string  sql = "select * from Student";
            SQLConn db  = new SQLConn();

            dt = db.selectData(sql);
            dataGridView1.DataSource = dt;
        }
示例#2
0
        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";
        }
示例#3
0
        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");
        }