private void sign_in_Click(object sender, EventArgs e) { /*try * { * con.conDB.Open(); * label1.Text = "connected"; * label1.ForeColor = Color.White; * con.conDB.Close(); * } * catch * { * label1.Text = "failed"; * }*/ MySqlDataAdapter sda = new MySqlDataAdapter("SELECT status from employee WHERE username = '******' and password = '******'", con.conDB); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count == 1) { this.Hide(); if (dt.Rows[0][0].ToString() == "master") { Dashboard da = new Dashboard(dt.Rows[0][0].ToString()); da.Show(); } else if (dt.Rows[0][0].ToString() == "user") { FrmEmployeeDashboard da = new FrmEmployeeDashboard(dt.Rows[0][0].ToString()); da.Show(); } } }
private void sign_in_Click(object sender, EventArgs e) { SqlDataAdapter sda = new SqlDataAdapter("SELECT status from admin WHERE username = '******' and password = '******'", con.conDB); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count == 1) { this.Hide(); if (dt.Rows[0][0].ToString() == "master") { Dashboard da = new Dashboard(dt.Rows[0][0].ToString()); da.Show(); } else if (dt.Rows[0][0].ToString() == "user") { FrmEmployeeDashboard da = new FrmEmployeeDashboard(dt.Rows[0][0].ToString()); da.Show(); } } }