private void button1_Click(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(ConnectionString); SqlDataAdapter adapt = new SqlDataAdapter("Select Count(*) From Admin Where Username = '******' And Password = '******'", con); DataTable dt = new DataTable(); adapt.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { Form F7 = new Dropbox(); F7.Show(); this.Hide(); } else { MessageBox.Show("Invalid Username or Password"); } } catch { MessageBox.Show("A error has ocured"); } }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); this.Hide(); Form D = new Dropbox(); D.Show(); }