private void button1_Click(object sender, EventArgs e) { //SQL Instructions........ connect.Open(); String query = "SELECT COUNT(*) FROM Logins WHERE Username = '******'AND SpecialPIN = '" + textBox2.Text + "'"; SqlCommand command = new SqlCommand(query, connect); SqlDataAdapter sda = new SqlDataAdapter(command); DataTable ds = new DataTable(); sda.Fill(ds); if (ds.Rows[0][0].ToString() == "1") { DashBoard dash = new DashBoard(); dash.Show(); this.Hide(); } else { MessageBox.Show("Wrong Credentials Try Again!"); this.Show(); textBox1.Text = ""; textBox2.Text = ""; } command.ExecuteNonQuery(); connect.Close(); }
private void button1_Click(object sender, EventArgs e) { DashBoard dash = new DashBoard(); dash.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { connect.Open(); String query = "UPDATE Courses SET " + textBox1.Text + " = 'Course Deleted!' WHERE StudentId= '" + textBox2.Text + "'"; SqlCommand command = new SqlCommand(query, connect); command.ExecuteNonQuery(); MessageBox.Show("Course Removed!"); DashBoard dash = new DashBoard(); dash.Show(); this.Hide(); connect.Close(); }
private void button1_Click(object sender, EventArgs e) { connect.Open(); String query = "INSERT INTO Courses(StudentId,Course1,Course2,Course3,Course4,Course5,Course6)VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "')"; SqlCommand command = new SqlCommand(query, connect); command.ExecuteNonQuery(); MessageBox.Show("Course Registration Completed!"); DashBoard dash = new DashBoard(); dash.Show(); this.Hide(); connect.Close(); }