예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(CString);

            con.Open();

            SqlCommand exe = new SqlCommand("INSERT INTO Rubric(Details,CloId) values('" + Details.Text + "','" + comboBox1.SelectedValue + "')", con);

            exe.ExecuteNonQuery();
            MessageBox.Show("Added!");
            this.Hide();
            Form7 frm = new Form7();

            frm.Show();
        }
예제 #2
0
파일: Form6.cs 프로젝트: sohaibarif28/202
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection c = new SqlConnection(string_con);

            c.Open();


            string     QUERY = "INSERT INTO Rubric(Details,CloId) values('" + Details.Text + "','" + comboBox1.SelectedValue + "')";
            SqlCommand cm    = new SqlCommand(QUERY, c);

            cm.ExecuteNonQuery();
            MessageBox.Show("Added!");

            Form7 frm = new Form7();

            frm.Show();
        }
예제 #3
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            SqlConnection con = new SqlConnection(CString);

            con.Open();

            if (e.ColumnIndex == dataGridView1.Columns["del"].Index)
            {
                int        row = e.RowIndex;
                int        sel = Convert.ToInt32(dataGridView1.Rows[row].Cells["Id"].Value);
                SqlCommand exe = new SqlCommand("DELETE FROM Rubric WHERE Id = '" + sel + "'", con);
                exe.ExecuteNonQuery();
                MessageBox.Show("Deleted!");
                this.Hide();
                Form7 form = new Form7();
                form.Show();
            }
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(ConnectionString);

            con.Open();


            SqlCommand exe = new SqlCommand("UPDATE dbo.Rubric SET Details = '" + CloDetails.Text + "' WHERE Id = '" + ID + "' ", con);

            exe.ExecuteNonQuery();

            MessageBox.Show("Edit Successfully!");

            Form7 frm = new Form7();

            this.Hide();
            frm.Show();
        }
예제 #5
0
        private void button6_Click_1(object sender, EventArgs e)
        {
            Form7 newFORM = new Form7();

            newFORM.Show();
        }