Newbie: Dataset - ComboBox synchronization

S

steve

Hello,

I have two questions involving Datasets and populating ComboBoxes and other
controls with them.

1) Two cmbboxes are populated by two different fields of the same table and,
of course, synchronized. However the second field is not required in the DB
and missing contents sometimes.
Ex:
Field1 Field2

john 1990
mary
paul
anna
mario 1967
james

......,etc.
So when the user scrols through cmbField1 there is no problem, however if
you want to scroll through the year there are big gaps that you go through
because there is no contents there. Is there a way to get around that and
STILL keep the cmb Boxes synchronized?

2) Now, after having the above from the same table and trying to get
*Related* info from another table in my DB (of course still synchronized
with the other two controls) I added a second table to the dataset with the
INNER JOIN info. I access the new field by : Table1.field3. But field3
belongs to Table2 !!! not Table1! Is this normal?
People say it's not a good idea to add more than one table in the same
dataset. If this is true how can I get Relational information that is still
synchronized? (i.e. fields 1 and 2 from Table1 and field 3 from Table 2)
The fact that I get what I want is not enough. I need to know if it's the
right way for my case and if there is s better way.

Any help/feedback would be Greately appreciated.
_steve_
 
W

W.G. Ryan eMVP

If I understand you correctly, simple binding should solve the first problem
provided they're both bound to the same control. As for the second issue -
don't do a Join unless you are POSITIVE you need to (ie you don't need to
submit the data back to the database and are in the mood to do a bunch of
extra work.) Instead use a DataRelation and bind from there. It will
simulate the join, require less data to be pulled over (because there aren't
the same redundancies) and is a much much cleaner approach that you'll come
to appreciate the first time you need to submit an update.
http://www.knowdotnet.com/articles/datarelation.html This should help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top