title: pass session variable into asp:gridview's sqldatasource select command
body: <p>I am currently having trouble trying to get a select command with a session variable in my asp gridview. I have been looking on here and other sites and have not really came across much. It's got to be a simple fix that i just have not came across yet. Here is my code</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ConnectionStrings:mySql_Connection %&gt;"
                      SelectCommand =  "Select [Username], [Name] FROM UserPassword WHERE CustID = '" &amp; session("CustID") &amp; "'&gt;
                  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>I'm not even sure if that is close to correct or not. I get <code>the server tag is not well formed</code>. Or invalid syntax. Can someone show how to do this. I've been stuck on this and its really bugging me.</p>