Link to home
Start Free TrialLog in
Avatar of Michael Meeks
Michael Meeks

asked on

How to open a different table using the same bindingsource - vb.net

I have a simple Winforms App - with a database with 2 tables (tableOne TableTwo)
The form has 1 textbox that is bound to the dataset for tableOne.
There is no coding at this time.  
Run the program - Textbox shows the first record of the tableOne

The form has 1 button that says change table.
However, (when coding) - when I attempt to change TextBox from one table to another,
all I get is errors.

The database is the same - there is only 2 tables - how can I switch between the two tables for
textbox to display - when I click the button?

Thank You!
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Meeks
Michael Meeks

ASKER

Thank You !   Although VB2017 - doesn't like your (method 2 shown) - since in 2017 it has changed.

(Informational)
IDE0017 Object initialization can be simplified pops up.

(Error)
BC30455 Argument no specidifed for parmeter "metadataChange of 'Public Overloads Sub ResetBindings(metadataChanged as boolean)

When I remove method 2 - these both go away!

Strange,  But I do thank you for steering me in the right direction.  It's a big help.

Thank You!
Mike
(Error) BC30455 Argument no specidifed for parmeter "metadataChange of 'Public Overloads Sub ResetBindings(metadataChanged as boolean)
Sorry, should be bs.ResetBindings(False)