Create an table in sql with list of UserID and Password.
Create an login page consist of two text box (User name and passowrd) and login button.
use the following coding:
SqlConnection Con = new SqlConnection();
Con= // Your connection statement goes here.
Int32 verify;
string query1 = "Select count(*) from loginn where uname='"+TextBox1.Text+"' and upass='"+TextBox2.Text+"' ";
SqlCommand cmd1 = new SqlCommand(query1, Con);
Con.Open();
verify= Convert.ToInt32( cmd1.ExecuteScalar());
Con.Close();
if (verify > 0)
{
//Successful login coding goes here.
}
else
{
//Unsuccessful login coding goes here.
}
Create an login page consist of two text box (User name and passowrd) and login button.
use the following coding:
SqlConnection Con = new SqlConnection();
Con= // Your connection statement goes here.
Int32 verify;
string query1 = "Select count(*) from loginn where uname='"+TextBox1.Text+"' and upass='"+TextBox2.Text+"' ";
SqlCommand cmd1 = new SqlCommand(query1, Con);
Con.Open();
verify= Convert.ToInt32( cmd1.ExecuteScalar());
Con.Close();
if (verify > 0)
{
//Successful login coding goes here.
}
else
{
//Unsuccessful login coding goes here.
}