I’ve hit the same problem again. I’ve already wrote 2 posts about the error “Exception Details: System.InvalidOperationException: ObjectDataSource ‘ods’ could not find a non–generic method ‘Update’ that has parameters: ….” ( Editable GridView with ObjectDatasource and Update method parameters. and Some workaround for ObjectDataSource: could not find a non-generic method ‘…’ .) And these posts are the most popular in my blog according to views statistics. Not because they are very useful – just because topic is very hot – a lot of people experience the same problem.
I’ve read again Brady Gaster’s detailed post and understood, that his sample very similar to mine. I also have table with integer IDENTITY primary key and 2 nvarchar columns. Ive used DataAdapter wizard to generate insert/update/delete methods without generating Stored Procedures and without support for optimistic cuncurrency. And I am using DetailsView instead of editable GridView.
I believe that the root of the problem is in the wrong assumption which parameters should have default Update method.
Just follow Brady’s example the function is
Update(String Firstname, String Lastname, int32 Original_PersonId, int32 PersonId)
How often developer needs to update IDENTITY PRIMARY KEY? If not, why we need the last parameter? If the generated Update will have just 3 parameters(Firstname, Lastname, Original_PersonId),GridView and DetailView will work as expected.
I’ve raised suggestion to MS “Generated default Update method in DataTableAdapter in a typed DataSet shouuld not update primary key”. Please rate/validate it.
UPDATE: Hurray! Posted by Microsoft on 5/05/2007: “We have fixed the issue with an additional update function.
The fix will be available in the next VS release.”