title: How can I use a variable in a SqlDataSource SelectCommand?
body: <p>So making a .Net site with VB and running off of a MySQL server.</p>
  
  <p>Trying to use a variable within the <code>connectionstring</code> to only retrieve certain data.</p>
  
  <p>I Currently have in the header:</p>
  
  <pre><code>&lt;script language="vbscript"&gt;
       Dim varSQLcommand as String
  
       varSQLcommand = "1"
  &lt;/script&gt;
  </code></pre>
  
  <p>and the connection string of</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:emergency systemsConnectionString3 %&gt;" 
      ProviderName="&lt;%$ ConnectionStrings:emergency systemsConnectionString3.ProviderName %&gt;" 
      SelectCommand= "SELECT * from tbldisaster WHERE Disaster_ID = " &amp; varSQLcommand &amp; "" &gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>Going to replace <code>varSQLcommand = "1"</code> with <code>varSQLcommand = Request.QueryString("ID")</code> and make the url <code>disasterdetails.aspx?ID={1}</code>.</p>
  
  <p>is this the Correct way to do what I want to do?</p>