Binding Basics

chrisguk

Active member
Joined
Nov 20, 2011
Messages
29
Programming Experience
Beginner
If I was using a MS Access DB it is possible to setup the following:

All tables normalised.

A form with 2 datasources. Main form and subform. You and independantly move the subform navigation controls seperate from the main form allowing you to add one to many records.

How can I easily acheive this in VB.Net, the same really with combo boxes?
 
No not quite.

Main form:

ID, Firstname, LastName, Age, etc etc

Subform or even a kind of subform control with the same form as the parent:

Address1, address2 etc etc

So if the person had two addresses they could add another to the address DB and thus linking to the parent form/table

Or which would probably be preferred a tab control placed on the parent form all containing linked forms.
 
This is usually called Master/Detail. This is done setting up a relationship between the two tables and binding the "detail" (addresses in your above example) controls to the relationship.

This article is pretty dated, but it's all I can find currently, it should give you a starting point: Using Visual Studio .NET Wizards to Create an N-Tiered Application - Part 2
Note that once you have datasources setup in your project, all you have to do is drag them to the form's designer surface and all necessary components will be created for you (you may have to write a line or two of code to load the data).
 
Back
Top