简体   繁体   English

从VB.NET中的会话填充SQLDataSource

[英]Populating SQLDataSource from Sessions in VB.NET

I have the below code and I am trying to make the connection string as well as the parameters that the pass to the stored procedure use values stored in a session. 我有下面的代码,我试图使连接字符串以及传递给存储过程的参数使用会话中存储的值。 How can this be done? 如何才能做到这一点?

    <asp:SqlDataSource ID="sqlds" runat="server" ConnectionString="<%# Session("ConnStrEP") %>" SelectCommandType="StoredProcedure" SelectCommand="GetGenInfo_Mines">
    <SelectParameters>
    <asp:Parameter DefaultValue="6" Name="RevNo" Type="String" />
    <asp:Parameter DefaultValue="1003992" Name="AppNo" Type="String" />

    </SelectParameters>
</asp:SqlDataSource>

An example of how to pass a session parameter can be found here: 在此处可以找到有关如何传递会话参数的示例:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sessionparameter.aspx http://msdn.microsoft.com/zh-CN/library/system.web.ui.webcontrols.sessionparameter.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM