LOGIN FORM CODE C#
string user = textBox1.Text;
string password = textBox2.Text;
string userdb,passworddb;
returnclass rc = new returnclass();
userdb = rc.scalarReturn("select count(ad_id) from administator where ad_name='" + user + "'");
if (userdb.Equals("0"))
{
MessageBox.Show("Invalid user name!");
}
else
{
passworddb = rc.scalarReturn("select ad_password from administator where ad_name='" + user + "'");
if (passworddb.Equals(password))
{
fk_ad= rc.scalarReturn("select ad_id from administator where ad_name='" + user + "'");
Form2 f=new Form2();
f.Show();
}
else
{
MessageBox.Show("Invalid Password!");
}
}
Thanks
ReplyDelete