'condition is expected' in query
<pre><code>SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=D:\\Projects\\csharp\\Login1\\App_Data\\Login.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd;
SqlDataReader dr;   

protected void  LinkButton1_Click(object sender, EventArgs e)
{
 conn.Open();
 cmd=new SqlCommand("Select * from LoginTable where User Name='"+TextBox1.Text+"'",conn);
 dr=cmd.ExecuteReader();   //  &lt;---error here

 if(dr.Read())
 {
   Label1.Text="User name already exist";
   this.Label1.ForeColor=Color.Red;
 }
 else
 {
   Label1.Text="Name available";
 }
}
</code></pre>

<p>It shows the following error near <code>dr=cmd.ExecuteReader();</code>:</p>

<blockquote>
  <p>An expression of non-boolean type specified in a context where a
  condition is expected, near 'Name'.</p>
</blockquote>

<p>Whats happening here</p>
