private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-LAI8526\SQLEXPRESS;Initial Catalog=user_dt;Integrated Security=True");
SqlCommand cmd = new SqlCommand("select * from lgn_table where user_id='" + textBox1.Text + "'and user_psd='" + textBox2.Text + "' and user_type='" + comboBox1.Text + "' ", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
{
SqlDataAdapter sda1 = new SqlDataAdapter("select user_type from lgn_table where user_id='" + textBox1.Text + "'and user_psd='" + textBox2.Text + "'", con);
DataTable dt1 = new DataTable();
sda1.Fill(dt1);
if (dt1.Rows[0][0].ToString() == "admin")
{
Form2 f = new Form2();
f.Show();
this.Hide();
}
if (dt1.Rows[0][0].ToString() == "employee")
{
Form1 d = new Form1();
d.Show();
this.Hide();
}
}