+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Data not updated until restart

  1. #11
    thek is offline VB.NET Forum Newbie thek is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    May 2009
    Posts
    22
    Reputation
    17

    Default

    Quote Originally Posted by jmcilhinney View Post
    If you're loading the data in your Load event handler and you want to be able to load the data elsewhere too then just take the code out of the Load event handler and put it into a method that you can call from anywhere.
    Then the records are duplicated, in the GUI (e.g they are there twice)

  2. #12
    MattP is offline VB.NET Forum All-Mighty MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2008
    Location
    USA
    Posts
    1,016
    Reputation
    533

    Default

    Quote Originally Posted by thek View Post
    Then the records are duplicated, in the GUI (e.g they are there twice)
    Only if you've set the TableAdapter's ClearBeforeFill property to False.

    TableAdapter Overview

  3. #13
    thek is offline VB.NET Forum Newbie thek is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    May 2009
    Posts
    22
    Reputation
    17

    Default

    You're on to something, but ClearBeforeFill is not a member of System.Data.OleDb.OleDbDataAdapter

  4. #14
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Age
    37
    Posts
    10,843
    Reputation
    1443

    Default

    ClearBeforeFill is a property of a strongly typed data adapter, ie a TableAdapter, which causes the code to call dataTable.Clear before each filling.

    I agree with the others here that you're taking the wrong approach to learn data access, the easier beginner start is to use the Visual Studio wizards. You know you can read the code it generates afterwards, if you wish to see 'how it's done in code' ?

  5. #15
    thek is offline VB.NET Forum Newbie thek is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    May 2009
    Posts
    22
    Reputation
    17

    Default

    I agree with the others here that you're taking the wrong approach to learn data access, the easier beginner start is to use the Visual Studio wizards.
    Hi guys

    I agree. I'll create a new tread to taking it from the start

    Thanks for your help (all of you)

    Kind regards,
    thek

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

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