It is an another method.
In same way you can do this in asp.net.
string cmd="select *from Admin where ID='"+txtFilenO.Text+"' and Password='"+textBox1.Text+"' ";
SqlCommand cmd1 = new SqlCommand(cmd,Db.GetConnection());
SqlDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
AdminMenu n = new AdminMenu();
n.lblsser.Text = dr[0].ToString();
n.Show();
this.Dispose();
this.Close();
cmd1.Connection.Close();
}
else
{
cmd1.Connection.Close();
MessageBox.Show("ID/Password is not valid");
}