You are on page 1of 1

TCS-B83788F64F6\SQLEXPRESS

Data Source=TCS-B83788F64F6\SQLEXPRESS;Initial Catalog=bhanu;Integrated Security =True

string uname = TextBox1.Text; string pwd = TextBox2.Text; int i; SqlConnection con = new SqlConnection("Data Source=TCS-B83788F64F6\\SQLE XPRESS;Initial Catalog=bhanu;Integrated Security=True"); con.Open(); SqlCommand cmd = new SqlCommand("select COUNT(username) from uname where username='" + uname + "' and password='" + pwd + "'and designation='clerk' ", c on); //SqlCommand cmd1 = new SqlCommand("select COUNT(password) from uname wh ere ", con); //m = (int)cmd1.ExecuteScalar(); i=(int)cmd.ExecuteScalar(); con.Close(); if (i == 1 ) { Session["uname"] = TextBox1.Text; Response.Redirect("Default.aspx"); } else { Response.Write("username or password is entered incorrect"); }

You might also like