How to use the Datagrid with multiple tables.

C

cr113

Suppose you have the following 2 database tables:


Table1 - primary key = Field1
Field1 Field2
a 1
b 2
c 2


Table2 - primary key = Field2
Field2 Field3
1 Y
2 Z


I can display this in a datagrid:


Field1 Field2 Field3
a 1 Y
b 2 Z
c 2 Z


How do I update the underlying database tables? It's easy with one
table but I can't find any documentation on how to do it with multiple
tables.
 
V

vMike

Suppose you have the following 2 database tables:


Table1 - primary key = Field1
Field1 Field2
a 1
b 2
c 2


Table2 - primary key = Field2
Field2 Field3
1 Y
2 Z


I can display this in a datagrid:


Field1 Field2 Field3
a 1 Y
b 2 Z
c 2 Z


How do I update the underlying database tables? It's easy with one
table but I can't find any documentation on how to do it with multiple
tables.

Take a look at dataset merge. The two table must have the same primary key,
so you will have to use field 2 as the primary key. You can use the missing
schema action to add the field3 column.
 

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