G
Guest
I have five related tables in SQL2K, with FK relations between them. I would
like to load all five into a DataSet, read AND update them, then sync the
changes to SQL2K. In effect, I would like to replicate the entire database
into a DataSet (it will always be a small database, so memory isn't an
issue)...
But can a DataAdapter handle multiple tables? It appears that I can use a
batched SELECT for the SelectCommand (SELECT * from Table1, SELECT * FROM
Table2, etc), so maybe one DataAdapter can (perhaps) Fill the DataSet with
all five tables, but what would the update/insert/delete commands look like
for a "single DataAdapter" solution?
On the other hand, if I use a separate DataAdapter for each table, then how
do these multiple data adapters synchronize their activities? (like when I
add a parent row to one table and a child to another table... how do the
DataAdapters know in what sequence they must do inserts to the database, or
is this a non-issue).
And a related question: I'm not getting all the constraints populated into
the DataSet when I Fill from a table. The Primary Key constraint gets
defined, but not a Unique Constraint that's also defined on the table (I have
MissingSchemaAction = AddWithKey)
DT
like to load all five into a DataSet, read AND update them, then sync the
changes to SQL2K. In effect, I would like to replicate the entire database
into a DataSet (it will always be a small database, so memory isn't an
issue)...
But can a DataAdapter handle multiple tables? It appears that I can use a
batched SELECT for the SelectCommand (SELECT * from Table1, SELECT * FROM
Table2, etc), so maybe one DataAdapter can (perhaps) Fill the DataSet with
all five tables, but what would the update/insert/delete commands look like
for a "single DataAdapter" solution?
On the other hand, if I use a separate DataAdapter for each table, then how
do these multiple data adapters synchronize their activities? (like when I
add a parent row to one table and a child to another table... how do the
DataAdapters know in what sequence they must do inserts to the database, or
is this a non-issue).
And a related question: I'm not getting all the constraints populated into
the DataSet when I Fill from a table. The Primary Key constraint gets
defined, but not a Unique Constraint that's also defined on the table (I have
MissingSchemaAction = AddWithKey)
DT