Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. SqlConnection connection = new SqlConnection(@"Data Source = SQL2016.fse.network;Initial Catalog=db_1620708_webuser;Persist Security Info=True; User ID =user_db_1620708_webuser; Password=Chester1991");
  2. connection.Open();
  3. SqlCommand cmd = new SqlCommand("select count (*) from webusers where Username ='" + TextUsername + "' and Password = '" + txtPassword + "'");
  4. cmd.Connection = connection;
  5. int M = Convert.ToInt32(cmd.ExecuteScalar());
  6. if (M > 0)
  7. {
  8. Response.Redirect("Default.aspx");
  9. }
  10. else
  11. {
  12. lBLInvalid.Visible = true;
  13. lBLInvalid.Text = "Invalid Username and Password";
  14. connection.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement