troubleshooting Question

Datakeyname - updatecommand

Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America asked on
1 Comment1 Solution408 ViewsLast Modified:
How can I update my data using DataKeyNames="RefID" when using <UpdateParameters>

 <asp:GridView ID="GridView3" runat="server" AllowPaging="True"
                    AllowSorting="True" AlternatingRowStyle-Wrap="True" AutoGenerateColumns="False"
                    AutoGenerateEditButton="True" DataKeyNames="RefID"
                    DataSourceID="SqlDataSource2" Font-Size="Small" FooterStyle-Font-Size="Medium"
                    PageSize="10" Width="698px">


<asp:BoundField DataField="RefID" HeaderText="RefID"
                            SortExpression="RefID" Visible="false" />

  <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                ConnectionString="<%$ ConnectionStrings:dbdoneConnectionString %>"        
                              SelectCommand= "my sp1" SelectCommandType="StoredProcedure"
                              UpdateCommand="my sp2" UpdateCommandType="StoredProcedure">   < parameter is where datakeyname = Refid


<UpdateParameters>  < I am have storeprocedure for this
                <asp:Parameter Name="RefID" String="RefID" />  ?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros