Questions on Databinding

  • Thread starter Thread starter Hemang Shah
  • Start date Start date
H

Hemang Shah

Hello

I've few questions regarding ADO & C#:

1) Is it possible to view tata from multiple tables in the Datagrid control
? Most of the examples I see are only for 1 table.

2) In Comboboxes, can we display multiple fields ? For example in a Form of
customers, we have a combo box to select the customer you want to change, so
in that combo box, when they drop down, can we have it to display "First
Name, Last Name, Customer ID, Customer type" but its databound field is
"Customer ID". I used to be able to do that in Access, C# is supposed to be
powerful but how do I do it ?

3) If you copy an access database into MSDE or SQL and it has autogenerate
fields, both in SQL & Access, how do we addresss that efficiently ?


Any insight into the above questions would be helpful & very appreciated.

Thank You
 
You can view data from multiple tables in a datagrid. One way is to add a
new table to the dataset you are using that contains the columns you need.
Then fill the new table manually. If you need full functionality in the
datagrid (not only view but edit/update/delete) then you can define a custom
dataadapter.

In a similar fashion you can build a synthetic table with a select that
combines the first and last name and bind that table to the combo box.

I am not sure what your sql/access question. There are many issues with
identitiy fields and datasets; if you are copying data you sometimes need to
turn the identity field off in the sql table during the copy.

Hope this helps
 
Thank You Bob

are there any demo samples which I can look at, to understand this better ?

Thank You
 
Back
Top