Exemple #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;
        }
Exemple #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";
        }
Exemple #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");
        }
Exemple #4
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            string  sql    = "delete from Student where ID = " + Convert.ToInt16(comboBox1.Text.ToString()) + "";
            SQLConn db     = new SQLConn();
            bool    verify = db.manipulateData(sql);

            if (verify == false)
            {
                MessageBox.Show("Some ERROR occured!");
            }
            else
            {
                MessageBox.Show("Record has sucessfully updated!");
            }
            this.Close();
        }
Exemple #5
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            string sql = "insert into Student values('" + textBox1.Text + "','" + textBox2.Text + "')";

            SQLConn db = new SQLConn();

            bool verify = db.manipulateData(sql);

            if (verify == false)
            {
                MessageBox.Show("Some ERROR occured!");
            }
            else
            {
                MessageBox.Show("Record has sucessfully added!");
            }
            this.Close();
        }