hi ,
protected void btnlogin_Click(object sender, EventArgs e)
{
string statment =string.Format("select * from information where Username={0} and Password={1}",TextBox1.Text ,TextBox2.Text)
SqlCommand cmd = new SqlCommand(statment, con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter ad = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
ad.Fill(dt);
if (dt.Rows.Count > 0)
{
Session["Username"] = TextBox1.Text;
Response.Redirect("Default3.aspx");
}
else
{
Label3.Visible = true;
Label3.Text = "Invalid username&password....!!!";
}
}