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!
Visual Basic.NET

Avatar of undefined
Last Comment
Ark

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ark

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
Ark

(Error) BC30455 Argument no specidifed for parmeter "metadataChange of 'Public Overloads Sub ResetBindings(metadataChanged as boolean)
Sorry, should be bs.ResetBindings(False)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes