exception in the connectivity code
<p>I am trying to connect to sql server from a web form but getting an incorrect syntax exception in the code.</p>

<p>protected void Button1_Click(object sender, EventArgs e)
        {</p>

<p>SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["HRMSConnectionString1"].ToString());</p>

<pre><code>  {
      SqlCommand cmd = new SqlCommand("select * from persons where User_Id="+uid.Text+"and Password!="+pswd.Text, cn);

      cn.Open();

      SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);   //exception in this line

      rdr.Read();

      Response.Write(rdr[0].ToString()); 
  }
</code></pre>

<p>}</p>

<p>Please guide me where m going wrong.</p>
