title: How can I use a data reader in ASP.NET
body: <p>I am learning to use select query for my program .</p>
  
  <p>This my code.</p>
  
  <pre><code>con.Open();
  
  SqlCommand cmd = new SqlCommand("select id from qw where name='" + TextBox1.Text + "'", con);
  SqlDataReader dr = SqlDataReader();
  dr = cmd.ExecuteReader();
  dr.read();
  TextBox2.Text = dr[0].Tostring();
  dr.close();
  con.Close();
  </code></pre>
  
  <p>it show this error message  </p>
  
  <p>'System.Data.SqlClient.SqlDataReader' is a 'type' but is used like a 'variable'</p>