string sql = "SELECT * FROM member WHERE Username = '" + this.txtUsername.Text +
"' AND Password = '" + this.txtPassword.Text + "' AND Status = '" + this.comboStatus.Text + "' ";
comm = new SqlCommand(sql, Conn);
da = new SqlDataAdapter(comm);
ds = new DataSet();
da.Fill(ds, "pl");
if (ds.Tables["Pl"].Rows.Count > 0)
{
if (ds.Tables["Pl"].Rows[0]["Status"] == "1" )
{
FormMain f = new FormMain();
f.Show();
this.Visible = false;
}
else if (ds.Tables["Pl"].Rows[0]["Status"] == "2" )
{
Form3 f = new Form3();
f.Show();
this.Visible = false;
}
}
else
{
MessageBox.Show("ไม่สามารถเข้าระบบได้");
}