Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataObjectSource DetailsView 'could not find a non-generic method that takes parameters'

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I have a problem with ASP.Net in Visual Studio 2010 (VB) that I am desperate to resolve.

I read data from an invoice header table to a DetailsView page via an ObjectDataSource using an Invoice class.
I simply want to edit the table via the DetailsView.
The DetailsView points to an ObjectDataSource in which the ‘SELECT’, UPDATE’, ‘DELETE’ and ‘INSERT’ options are all set via the Design ‘>’ button
option against the ObjectDataSource in the Design mode of Visual Studio.

When I run the project I can see the data on the page fine - it is populated by returning a list of ‘Invoice’ objects to the ObjectDataSource
in the ‘SELECT’ method. I can page through the table without a problem.

When I select the ‘Edit’ option on the DetailsView the page for a row the page goes into modify mode and I can change the field
contents in the DetailsView. So far so good. However when I hit ‘Update’ to call the ‘Update’ method attached to the ObjectSource I get the following error:-

Code:
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateINVOICERow' that takes parameters of type 'SFWEditor.INVOICE'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateINVOICERow' that takes parameters of type 'SFWEditor.INVOICE'.
Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 
[InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateINVOICERow' that takes parameters of type 'SFWEditor.INVOICE'.]

Common sense says there must be something wrong with parameters or the location of the update method I have selected for the Update.
But I can’t see what the problem is as the only parameters defined are two Invoice instances representing the original_Invoice and the current Invoice.
The Update method is in the same .vb class file as the Select method which works.

Code:
<DataObjectMethodType.Update)>
Public Shared Function UpdateINVOICERow( ByVal original_INVOICE As INVOICE, 
                                         ByVal          INVOICE As INVOICE) As Integer
. . . 
. . . perform the update
. . .

End Function

The signature of the method I have selected in the Visual Studio designer shows :-
Code:
UpdateINVOICERow(INVOICE original_INVOICE, INVOICE INVOICE), returns Int32
This looks fine to me as it shows the ‘INVOICE’ class passed as an original and current value.
I have achieved this sort of thing before using a list of fields without a class but for some reason the class option
doesn't work.

If anybody can guide me on this I’ll name my first child after them ( I'm sure my wife would understand ).
I’m in deep trouble on this one.
Thanks.


Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top