Define SqlDatSource in another function?

D

D. Shane Fowlkes

<asp:SqlDataSource ID="sqlCapBudgetItems" runat="server"
ConnectionString="<%$ ConnectionStrings:NETWebConnectionString %>"
SelectCommand="SELECT * FROM [CapitalBudgets] WHERE ([ApplicationID] =
@ApplicationID)">

<SelectParameters>

<asp:parameter DefaultValue="5477" Name="ApplicationID" Type="Int32" />

</SelectParameters>

</asp:SqlDataSource>



Looking at the sample above, can I define the actual value of the
asp:parameter to something else in another sub? The 5477 value is just for
testing but can I dynamically change this to whatever I want. I've tinkered
with some syntax but nothing is working so far. For example....

sub page_load()

My Sub()

end sub



My Sub()

'Look up user's ID record and change value of asp:parameter
DefaultValue to user's ID so I can load GridView with user data.

End Sub



Thanks!!



(VB.NET 2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top