Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

Posted

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.

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...