MTSkull Posted May 14, 2010 Posted May 14, 2010 I am trying to tie a sqlDatasource to a Stored Procedure. The stored procedure looks like... dbo.Select_SomeData_BySuperAssemID (@SuperAssemID as int) Select * From SomeTable Where SuperAssemID= @SuperAssemID Then the asp page is accessed via ... Response.Redirect("DataPage.aspx?SuperID=" + ID); In the code behind I can access and use Super ID no problem, but when I try to set up the SQL data source to access super ID it returns nothing. My gridview is bound to the following control. <asp:SqlDataSource ID="sqlSubAssemblies" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnStr %>" SelectCommand="Select_SomeData_BySuperID" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:SessionParameter Name="SuperAssemID" SessionField="SuperID" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> Thanks in advance... Brian Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Administrators PlausiblyDamp Posted May 14, 2010 Administrators Posted May 14, 2010 It looks as though you are passing the parameter as part of the query string, yet in the markup you are using a SessionParameter, are you copying the query string value into the session first? If not you could just use a Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
MTSkull Posted May 14, 2010 Author Posted May 14, 2010 How easy was that! I switched from session to Query String and passed the session variable as the value and presto it worked. Your help is greatly Appreciated. Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.