Error when updating datagridview in

Posted on 2012-08-17
Last Modified: 2012-08-25
i have 3 gridviews. when i select the first gridview the second one comes visible and when i select the second one it will select the third one. The problem is when the second gridview: when i try to update the data it gives the following error:
 Exception message: Exception of type 'System.Web.HttpUnhandledException' was thrown.

Inner exception: System.InvalidOperationException: ObjectDataSource 'dsContractePos' could not find a non-generic method 'CONTRACTEPOS_UPD' that has parameters: CONTRACTID, ARTICOLID, cantmin, cantmax, pretftva, CANTITATE_MIN, CANTITATE_MAX, PRETFARATVA, contractposid.%0d%0a at System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type type, String methodName, IDictionary allParameters, DataSourceOperation operation)%0d%0a at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)%0d%0a at System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback)%0d%0a at System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation)%0d%0a at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)%0d%0a at System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e)%0d%0a at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)%0d%0a at System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e)%0d%0a at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)%0d%0a at System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e)%0d%0a at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)%0d%0a at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)%0d%0a at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)%0d%0a at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)%0d%0a at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

i tried to recreate the SP and the function in the controller, but without luck.

thanks advanced.
Question by:Molnar István
    LVL 20

    Expert Comment

    Please show us the objectdatasource code
    LVL 13

    Author Comment

    by:Molnar István
    <asp:ObjectDataSource ID="dsContractePos" runat="server" 
            <asp:ControlParameter ControlID="gvContracte" DefaultValue="-1" 
                Name="contractid" PropertyName="SelectedValue" Type="Int32" />
            <asp:Parameter Name="contractposid" Type="Int32" />
            <asp:Parameter Name="contractid" Type="Int32" />
            <asp:Parameter Name="articolid" Type="Int32" />
            <asp:Parameter Name="cantmin" Type="Decimal" />
            <asp:Parameter Name="cantmax" Type="Decimal" />
            <asp:Parameter Name="pretftva" Type="Decimal" />

    Open in new window

                        dsContractePos.UpdateParameters.Add("ARTICOLID", articoleddl.SelectedValue);
                        dsContractePos.UpdateParameters.Add("CANTITATE_MIN", cantmintxt.Text);
                        dsContractePos.UpdateParameters.Add("CANTITATE_MAX", cantmaxtxt.Text);
                        dsContractePos.UpdateParameters.Add("PRETFARATVA", pretftvatxt.Text);
                        dsContractePos.UpdateParameters.Add("contractposid", e.CommandArgument.ToString());
                        dsContractePos.UpdateParameters.Add("CONTRACTID", gvContractePos.DataKeys[gvContractePos.EditIndex]["CONTRACTID"].ToString());

    Open in new window

    LVL 13

    Accepted Solution

    i have found the problem:
    -i recreated the table and the SP in the database
    -i modified the following in the aspx page:
            <asp:Parameter Name="contractid" Type="Int32" />
            <asp:Parameter Name="partenerid" Type="Int32" />
            <asp:Parameter Name="datastart" Type="DateTime" />
            <asp:Parameter Name="dataend" Type="DateTime" />
            <asp:Parameter Name="datareziliere" Type="DateTime" />
            <asp:Parameter Name="stareid" Type="Int32" />
            <asp:Parameter Name="tipcontractid" Type="Int32" />
            <asp:Parameter Name="datacontract" Type="DateTime" />
    LVL 13

    Author Closing Comment

    by:Molnar István
    i have found the solution myself

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now