By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

Why inconsistency with dataSource and dataMember in the DataBindings method?

P: n/a
I have a form with textboxes that are bound to a dataset. The dataset
contains two tables and some of the textboxes use data from one table
while other textboxes use data from the other table. I use a datagrid
to allow all of the records from one of the table to be displayed and
when one record is selected with the mouse, the textboxes are filled
with data from the other table. When I go to bind the textboxes during
run-time, I have need to specify the dataSource and dataMember
parameters differently otherwise one of the textboxes will not sync its
data with the datagrid. For example:

this.textbox1.DataBindings.Add(new Binding("Text",
MyDataSet.DetailsTable, "SomeColumn"));

this.textbox2.DataBindings.Add(new Binding("Text", MyDataSet,

When I use the first line above the data is synced with the datagrid.
Using the second line causes the column in the main table (the table
shown in the datagrid) to also be synced. But my question is why? In
the first line, the dataSource indicates the name of the table (the one
that shows the details) while the second line uses only the dataset but
includes the table name in the dataSource parameter. Can someone
explain this inconsistancy?

Johann Blake

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.