private void metroButton2_Click(object sender, EventArgs e) { panel p = new panel(); p.Show(); this.Hide(); }
private void login_Click(object sender, EventArgs e) { SqlConnection sc = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Jatin\Documents\access.mdf;Integrated Security=True;Connect Timeout=30;"); SqlDataAdapter sda = new SqlDataAdapter("select count(*) from acc where [user] ='" + user.Text.ToString() + "' and pass ='******'", sc); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { panel mp = new panel(); mp.Show(); this.Hide(); } else { MessageBox.Show("No"); } sc.Close(); }