Monday, 18 September 2017

Database Application # 2 (login C#)

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!");
}

   
    }

1 comment:

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...