mike

mike

  • NA
  • 23
  • 4.9k

DetailsView not binding to GridView with stored procedure

Jun 14 2016 11:26 AM
I'm trying to display records in a DetailsView after I click on the record in the GridView. Everything works good if I don't use a stored procedure to populate the DetailsView, but if I try to use a SP in the DetailsView it won't display after clicking on the record in the GridView. For some reason it won't bind together with the Stored Procedure. I click on the GridView record and nothing happens. Could someone let me know what I'm doing wrong. Thanks
 
Both GridView & DetailsView have this: DataKeyNames="ShippingIdentity"
 
<asp:SqlDataSource ID="Shipping_DS" runat="server" ConnectionString="<%$ ConnectionStrings:NFIConnection %>" SelectCommand="GetShippingInfoDetailsView" SelectCommandType="StoredProcedure" >
<SelectParameters>
<asp:ControlParameter ControlID="ManageQuotesGridView" Name="ShippingIdentity" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
 
 
Stored Procedure:
 
SELECT ShippingIdentity,
OrigPortDoor,
OrigPortCode,
AirExport,
OrigCity,
OrigState,
OrigZip,
OrigCountry,
DestPortDoor,
DestCity,
DestState,
DestZip,
DestCountry,
ShippingLane
FROM ShippingInfo
RETURN
 
 

Answers (2)