Results 1 to 2 of 2

Thread: Update Database Error

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    31

    Update Database Error

    when I want use Update method for OleDbAdapter show this error

    Update require a valid UpdateCommand when passed DataRow collection with deleted Rows.

    how solve that?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Update Database Error

    That is definitely not the error message you got. You have mixed two possible errors into one. The error message would have either paired the UpdateCommand with edited or changed rows and the DeleteCommand with deleted rows. Basically, you need to specify the SQL code that will be used to update the database. The OleDbDataAdapter class has four properties that control how the data is retrieved from (SelectCommand) and sent to (DeleteCommand, InsertCommand and UpdateCommand) the database. If you want to delete, insert or update rows then you need to specifiy the appropriate command. I suggest you take a look at the data access samples provided with the 101 samples, which you can find in a sticky thread at the top of this forum.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width