Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["shopingConnectionString1"].ConnectionString);
- string s = "select * from login";
- SqlCommand com = new SqlCommand(s, con);
- con.Open();
- if (con.State == ConnectionState.Open)
- {
- SqlDataReader dtr;
- dtr = com.ExecuteReader();
- while (dtr.Read())
- {
- if (dtr[0].ToString().Equals(TextBox1.Text) && dtr[1].ToString().Equals(TextBox2.Text))
- {
- Response.Cookies["uname"].Value = TextBox1.Text;
- Response.Cookies["pwd"].Value = TextBox2.Text;
- Response.Cookies["role"].Value = dtr[2].ToString();
- FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false);
- }
- else
- {
- Label1.Text = "your credential are incorrect";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement