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

Discussion in 'ASP .Net' started by dave, Mar 16, 2007.

  1. dave

    dave Guest

    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.
    dave, Mar 16, 2007
    #1
    1. Advertising

  2. dave

    SAL Guest

    See if this attribute is in the markup for the control:
    OldValuesParameterFormatString="original_{0}
    if it is, try getting rid of it and see if that stupid error goes away.

    If is unlikely that your update method expects any of the original values to
    come along for the ride. There's probably a better way to do this but I'm
    still really new at this too so it's what I did.

    S

    "dave" <> wrote in message
    news:...
    > 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.
    >
    SAL, Mar 16, 2007
    #2
    1. Advertising

  3. dave

    SAL Guest

    Oh, more ideas here.
    Alternatively, if you want to ensure concurrency, you could write a business
    logic layer class that maps to your table adapter. In that class, you could
    write an update method that takes the original values plus the new values
    that are shown in your code below and check to see if the values have change
    since you started your editing session, if they have, you know another user
    has changed them and you can ask your user if they want to overwrite the
    changed values. Just a thought.

    This website talks about a lot of this stuff in tutorial fashion:
    http://www.asp.net/learn/dataaccess/tutorial17vb.aspx?tabid=63
    I've still come up with a lot of errors and questions though.
    S

    "SAL" <> wrote in message
    news:...
    > See if this attribute is in the markup for the control:
    > OldValuesParameterFormatString="original_{0}
    > if it is, try getting rid of it and see if that stupid error goes away.
    >
    > If is unlikely that your update method expects any of the original values
    > to come along for the ride. There's probably a better way to do this but
    > I'm still really new at this too so it's what I did.
    >
    > S
    >
    > "dave" <> wrote in message
    > news:...
    >> 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.
    >>

    >
    >
    SAL, Mar 16, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dotnet Gruven
    Replies:
    1
    Views:
    5,179
    Steven Cheng[MSFT]
    Sep 14, 2005
  2. Replies:
    2
    Views:
    4,071
  3. =?Utf-8?B?dHBhcmtzNjk=?=

    ObjectDataSource could not find a non-generic method error

    =?Utf-8?B?dHBhcmtzNjk=?=, Apr 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    14,557
    =?Utf-8?B?dHBhcmtzNjk=?=
    May 4, 2006
  4. Dennis
    Replies:
    0
    Views:
    1,153
    Dennis
    Jul 1, 2006
  5. Replies:
    0
    Views:
    698
Loading...

Share This Page