protected void Button1_Click(object sender, EventArgs e)
{
string tccuser = this.tccuser.Text.ToString();
string tccpass = this.tccpass.Text.ToString();
string cmdstring = "select * from tcclogin where tccuser = '"+tccuser+"' and tccpass='"+tccpass+"'";
SqlConnection connection = new SqlConnection(connstring);
SqlCommand sqlcmd = new SqlCommand(cmdstring, connection);
SqlDataReader rd;
connection.Open();
rd = sqlcmd.ExecuteReader();
if (rd.Read())
{
Session["username"] = tccuser;
Response.Redirect("index.aspx");
}
else
{
this.Label17.Text = "Wrong username or password!";
}
}
{
string tccuser = this.tccuser.Text.ToString();
string tccpass = this.tccpass.Text.ToString();
string cmdstring = "select * from tcclogin where tccuser = '"+tccuser+"' and tccpass='"+tccpass+"'";
SqlConnection connection = new SqlConnection(connstring);
SqlCommand sqlcmd = new SqlCommand(cmdstring, connection);
SqlDataReader rd;
connection.Open();
rd = sqlcmd.ExecuteReader();
if (rd.Read())
{
Session["username"] = tccuser;
Response.Redirect("index.aspx");
}
else
{
this.Label17.Text = "Wrong username or password!";
}
}