I'm trying to retrieve as400 data into a gridview by passing a value to a parameter from data stored in a session variable, gathered from a text box. If I hardwire the query selection, it works fine, but trying to pass the parmameter gives the error: SQL0206: Column @myParm not in specified tables.
I don't get this error when using tables from SQL Server. Is this possible to do, or should I take another approach? Any suggestions are appreciated.
<asp:SqlDataSource ID="SqlAS400" runat="server"
ConnectionString="<%$ ConnectionStrings:conAS400 %>"
ProviderName="<%$ ConnectionStrings:conAS400.ProviderName %>"
SelectCommand="SELECT field1, field2 FROM MYLIB.MYFILE WHERE field1 = 'ABC'"> works fine
SelectCommand="SELECT field1, field2 FROM MYLIB.MYFILE WHERE field1 = @myParm "> fails
<SelectParameters>
<asp:SessionParameter Name="myParm" SessionField="gMyParm" Type="String" />
</SelectParameters>
</asp:SqlDataSource>