title: Query string in SQL command c#
body: <p>First of all.. excuse me for my bad English , i hope to be understood.</p>
  
  <p>I'm regullar to work with LINQ , the SQL is new for me.</p>
  
  <p>i'm trying to do the next thing: i have the next method on c#:</p>
  
  <pre><code>public string niceMethod() 
  { 
      SqlConnection connection = new SqlConnection("Data Source=*******;Integrated Security=False;"); 
      string commandtext = "SELECT bla FROM items WHERE main = 1"; 
      SqlCommand command = new SqlCommand(commandtext, connection); 
      connection.Open(); 
      string tDate = (string)command.ExecuteScalar(); 
      connection.Close(); 
      return tDate; 
  }
  </code></pre>
  
  <p>I have page for example: <code>items.aspx?nID=144</code></p>
  
  <p>how can i do that the SELECT command will be with querystring and that will take the value</p>
  
  <p>from the "items" table by the id (nID) that show on the address ?</p>
  
  <p>The table have the design for example:<code>id, title, bla, main.</code></p>