Results 1 to 5 of 5

Thread: Updating a database from dataset

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598

    Updating a database from dataset

    Hi,

    Sorry I have to post a attachement but I thought it would be the best way for someone to my problem.

    The problem is when I click on my button to update to the data base the dataset updates but the database does not seem to, Could someone please help with this please?

    Thanks

    Loftty
    Attached Files Attached Files
    Last edited by Hack; Jan 17th, 2006 at 08:21 AM.

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

    Re: Updating a database from dataset

    I'm not downloading your attachment. All you needed to do was post the code you use to do the update. Do you get an error? If so what was the message. A common mistake is to call AcceptChanges before calling Update. Are you doing that?
    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598

    Re: Updating a database from dataset

    Hi,

    I fill the Dataset like so
    Code:
    oleDbDataAdapter1.Fill(dataSet11);
    And I change a value like so
    Code:
    dataSet11.Contacts[0].Address_1 = "Why is this not working";
    oleDbDataAdapter1.Update(dataSet11,"Contacts");
    Thanks

    Loftty

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Updating a database from dataset

    In accordance with this policy, the attachment has been edited and all executable or compiled files have been removed.

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

    Re: Updating a database from dataset

    The Update method returns the number of rows affected. What value does your call return?
    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