Passing a Session.Item to a MySQL query
<p>I have a aspx web page that has a session variable:</p>

<pre><code>Dim UserName As String = CType(Session.Item("UserName"), String)
</code></pre>

<p>I am attempting to include this variable in the <code>MySQL</code> query of a <code>SqldataSource</code> for a Databound <code>GridView</code> control:</p>

<pre><code>Dim Sql As String = "SELECT DeviceDescription, DeviceType, DeviceID 
   FROM validate WHERE ClientID='" &amp; UserName &amp; "'"
</code></pre>

<p>However, this does not work.</p>

<p>How do you pass/include this <code>session</code> variable in the <code>DataSource</code> of the <code>GridView</code>?</p>
