"could not find a non-generic method" when creating a very simple example with typed datasets



Hi,

I have searched for the answer for this error message without
success. I have seen the question many times though:)

I create an ASP.NET project (VS 2005, C#), and use a very simple .mdf
file (which I can provide if necessary). I use 'Add new Item' and
pick 'DataSet'. I believe this creates a TypedDataSet, CORRECT? I
take all the defaults as far as Insert, and I pick the advanced tab
and ask for Update Statements and Delete Statements to be generated.
I also ask for concurrency.

I throw a ObjectDataSource on the Page and use the DataSet I just
created. I then throw a GridView on the page and use the
ObjectDataSource just created. I also set it up for Deleting, Editing,
Sorting. I can run the program and see the data, and Sorting works
fine. However, when I hit Delete on a row, nothing happen. When I
edit, it goes into edit mode fine, but when I hit upate, I get:

ObjectDataSource 'ObjectDataSource1' could not find a non-generic
method 'Update' that has parameters: date, miles, hours, minutes,
seconds, description, Original_id, Original_date, Original_miles,
Original_hours, Original_minutes, Original_seconds,
Original_description.

What is going on here? I would think this is a pretty simple example
and should work. I have another clue....
Based on reading other newsgroups I tried changing the
OldValuesParamatersFormatString from Original_{0} to {0}. When I do
this, the behavior is reversed, the Update does nothing, the delete
caused an error like the one above.

Like I said, I've seen this question posed many times but I have not
seen an answer. Or I did not understand the answer, I am new to
ASP.NET programming.

If you got this far, thank you, and I would also be curious what
people think of this approach to get data. Would I be better off
writing my own dataclasses for example? Can I use the dataset
approach but not have Visual Studio generate the Update, Delete, etc.
If so, can you give me examples of what they should look like?

Please let me know if I should provide more information or if there is
a more appropriate newsgroup.

With many thanks,

Dave.

.



Relevant Pages

  • Re: "could not find a non-generic method" when creating a very simple example with typed dataset
    ... I throw a ObjectDataSource on the Page and use the DataSet I just ... edit, it goes into edit mode fine, but when I hit upate, I get: ... Based on reading other newsgroups I tried changing the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Ajax - "exception has been thrown by the target of an invocation"
    ... ObjectDataSource will throw an exception with a specific error message, ... on the client side the only error message displayed is "exception has been ... thrown by the target of an invocation". ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ObjectDataSource has no values to insert error
    ... If I'm using a custom DataObjectType does ... parameters to the insert method via the InsertParameters collection ... associated with the ObjectDataSource, i.e. myInsertMethod(string name, ... Doing the latter I keep getting the error message ...
    (microsoft.public.dotnet.framework.aspnet)
  • formview, objectdatasource, update method
    ... in edit mode when i click update i receive the following ... The 'ActionID' property on the type specified by the DataObjectTypeName ... I've been trying to find out how to tell the objectdatasource that this ... ''' that this property is the primary key and as such, ...
    (microsoft.public.dotnet.framework.aspnet)
  • ObjectDataSource has no values to insert error
    ... I'm having trouble using the insert method of an ObjectDataSource that ... If I'm using a custom DataObjectType does ... associated with the ObjectDataSource, i.e. myInsertMethod(string name, ... Doing the latter I keep getting the error message ...
    (microsoft.public.dotnet.framework.aspnet)

Loading