tags:

views:

18

answers:

1

I have following code

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
UpdateCommand="UPDATE [gMeter] SET ... [userId] = @userId ...

I need to parametr @userId assign session variable Session["userId"], any ideas? I tried

[userId] = <%= Session["userId"]%>

But it does not works.

+4  A: 

Try this inside your asp:SqlDataSource

<asp:SessionParameter Name="userId" SessionField="userId" Type="Int32" />
Rubens Farias
Thank you, excellent answer :)
markoniuss