Having trouble with <tableadapter>.dispose RRS feed

  • Question

  • Hi,

    I've got a form with 2 combo boxes and a tab control that has 2 tabs.  It's all been hooked up using binding sources and table adapters.

    When the form loads it populates the 1st combo box with the appropriate choices.  The user selects a choice, clicks a button and it loads the corresponding information for that choice in the 1st tab.  It also populates the 2nd combo box with another set of choices.

    When the user selects a choice in that 2nd box and clicks a button, it loads the 2nd tab with the corresponding information.

    If the user then goes back to the 1st combo box and selects a new choice, it will load the new information in the 1st tab just fine, but the data in the 2nd tab needs to be cleared until the user makes a selection from that 2nd combo box.

    Clearing the fields isn't that big of a deal, but what I'm worried about is the table adapter still associating the information from the previous record with the new record that was selected from the 1st combo box.

    I tried clearing the data using me.<tableadaptername>.dispose when the user clicks the button tied to the 1st combo box, but the information in the 2nd tab still remains.

    How do I go about clearing this data?
    Wednesday, September 5, 2007 7:12 PM


  • Nevermind, I figured it out.

    I needed to do me.<dataset>.<tablename>.clear instead of trying it directly from the table adapter.
    Wednesday, September 5, 2007 7:28 PM