MultipleBindingContexts
===================

All objects that inherit from System.Windows.Forms.Control have a BindingContext property.  It is therefore possible to return a CurrencyManager from the BindingContext of each control on a form.

In form frmMultipleDataSets, three separate strongly typed DataSet objects are declared and instantiated; all are based on the schema defined in dsNw.xsd.  (That schema includes only a Products table with two columns, ProductId and ProductName.)

Separate CurrencyManagers are obtained from the BindingContexts of the txtName1, txtName2, and txtName3 TextBoxes. Each is obtained using a distinct DataSet.  Each of the four navigational controls on the form (First, Previous, Next, and Last) first position the record pointer in the first CurrencyManagers, then position the record pointers in the second and third CurrencyManagers using an offset obtained from the NumericUpDown controls on the form (and which is therefore under the user's control at runtime).  Exercising the navigational controls demonstrates that the CurrencyManagers are indeed separate, and that each is keeping a different position pointer.

Form frmOneDataSet is similar to frmMultipleDataSets, except that in the former only one DataSet object is instantiated. Again, the BindingContexts of the three TextBoxes txtName1, txtName2, txtName3 are invoked to get a CurrencyManager object, but in this form each BindingContext is passed the same DataTable (the Products table in the only instantiated DataSet.

Exercising the navigational controls in this form illustrates that the three CurrencyManagers thus obtained are in fact the same CurrencyManager. Changes to the value of the Position property of one affect all three sets of ProductId and ProductName TextBoxes.

You can see how this has to be by examining the statements that establish DataBindings for the various bound controls:

        Me.txtId1.DataBindings.Add("Text", Me.m_tblX, "ProductId")
        Me.txtId2.DataBindings.Add("Text", Me.m_tblX, "ProductId")
        Me.txtId3.DataBindings.Add("Text", Me.m_tblX, "ProductId")

Note that the Add method for the DataBindings collection does not reference a specific CurrencyManager: only a specific data source (m_tblX, which refers to the Products table of the only instantiated DataSet). A data binding is thus specific only to a data source, and not to a CurrencyManager; and therefore all CurrencyManagers obtained for a given data source within a form will be the same, regardless of the BindingContext through which they are obtained.

Suggested Experiments
====================
1. Open form frmMultipleDataSets by clicking, on the Switchboard form, the <Go> button next to the labels "Multiple DataSets" and "Multiple CurrencyManagers".
2. Click the navigational button that positions the record pointer for the first CurrencyManager to the first record in its datasource.  Note that the position pointers in the second and third CurrencyManagers are offset from that in the first CurrencyManager by the amount shown in the two NumericUpDown controls labelled "Offset".
3. Move around in the datasources by using the navigational buttons. If you like, change the offsets and move around some more.  The offsets can take values from -10 to +10.  (These are arbitrary limits, but are enforced by the NumericUpDown controls.)  Note that navigation "wraps": if a command is given to move beyond the last record in a given datasource, the pointer is repositioned to the first record; and so forth.
4. Now try the same set of exercises with frmOneDataSet, noting that position points for the three CurrencyManagers are not kept separate, indicating that the CurrencyManagers variables in the code in fact refer to the same single CurrencyManager.


