Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to bind SqlDataSource by viewstate value, I used it in where statement

This the SqlDataSource code in HTML:

ASP.NET
<asp:SqlDataSource ID="SeatsDS" runat="server" ConnectionString="<%$ ConnectionStrings:CSCinema %>" SelectCommand="SELECT * FROM [ShowRoomSeat] WHERE ([ShowRoomID] = @ShowRoomID)">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="ViewState("RoomID")" Name="ShowRoomID" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>


But it didn't successful..

this is the ViewState : ViewState("RoomID")
Posted
Comments
Arkadeep De 19-Jun-15 5:12am    
<asp:Parameter DefaultValue='<%# ViewState("RoomID") %>' Name="ShowRoomID" Type="Int32" />

try this one...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900