sqldatasource update method

i cannot get my update to work within my gridview.
i get the following error.
Procedure or function sp_GCN_Update has too many arguments specified
<Columns>
                            <asp:TemplateField HeaderText="Update" ShowHeader="False">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                        Text="Update"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="Cancel"></asp:LinkButton>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                        Text="Edit"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="GCNID" HeaderText="GCNID" ReadOnly="True" SortExpression="GCNID" />
                            <asp:BoundField DataField="GCN" HeaderText="GCN" ReadOnly="True" SortExpression="GCN" />
                            <asp:TemplateField HeaderText="ExpectedVolume" SortExpression="ExpectedVolume">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtExpectedVolume" runat="server" Text='<%# Bind("ExpectedVolume") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblExpectedVolume" runat="server" Text='<%# Bind("ExpectedVolume") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Report" HeaderText="Report" ReadOnly="True" SortExpression="Report" />
                            <asp:BoundField DataField="BatchCode" HeaderText="BatchCode" ReadOnly="True" SortExpression="BatchCode" />
                            <asp:BoundField DataField="CSRep" HeaderText="CSRep" ReadOnly="True" SortExpression="CSRep" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    <asp:SqlDataSource ID="sql_dsGetGCN" runat="server" ConnectionString="<%$ ConnectionStrings:ReportsDataConnectionString %>"
                        SelectCommand="sp_GetGCNs" SelectCommandType="StoredProcedure"
                        UpdateCommand="sp_GCN_Update" UpdateCommandType="StoredProcedure">
                        
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddl_GCN" Name="GCN" PropertyName="SelectedValue"
                                Type="String" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ExpectedVolume" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>

my sp
--CREATE PROCEDURE [dbo].[sp_GCN_Update]
ALTER PROCEDURE [dbo].[sp_GCN_Update]

	@ExpectedVolume int	

AS

BEGIN

UPDATE
	tblGCN
SET
	ExpectedVolume = @ExpectedVolume
WHERE
	ExpectedVolume = @ExpectedVolume
END

Open in new window

aneilgAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aneilgAuthor Commented:
                   <asp:SqlDataSource ID="sql_dsGetGCN" runat="server" ConnectionString="<%$ ConnectionStrings:ReportsDataConnectionString %>"
                        SelectCommand="sp_GetGCNs" SelectCommandType="StoredProcedure"
                        UpdateCommand="sp_GCN_Update" UpdateCommandType="StoredProcedure">
                       
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddl_GCN" Name="GCN" PropertyName="SelectedValue"
                                Type="String" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ExpectedVolume" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
0
SriVaddadiCommented:
Your update query does not seem right though.

UPDATE
      tblGCN
SET
      ExpectedVolume = @ExpectedVolume
WHERE
      ExpectedVolume = @ExpectedVolume

You are trying to update a record with the same value as existing? does not make sense
0
aneilgAuthor Commented:
What should my sp be like.

my table is called tblGCN
and i want to update the expectedvolume field.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.