R
Rich
Hello,
My goal with the question is to make sure I'm not doing
this the hardest way possible. I have a dataAdapter (da1)
which I create in the formload event and I have 2 source
tables (tbl1 and tbl2) from a sql server which I join in
the da1 select command. Then I fill a table (t0) in a
dataset (ds1) with this set of data from the 2 source
tables. To add new data to the source tables (tbl1 and
tbl2) or to update the data in the source tables I create
2 additional Adapters (da2, da3) which add tables t1 and
t2 to ds1. da2 links to tbl1 and da3 links to tbl2. I
update the fields for tbl1 and call da2.Update(ds1, "t1"),
then I update the fields for tbl2 and call da3.Update
(ds1, "t2"). The other thing I tried was to reset the
selectcommand for da1 from the join sql to Select * from
tbl1 and then again da1.Update(ds1, "t1"), then change the
selectcommand to select * from tbl2...
The question is if I am being inefficient here or
overkill, or is this how it is done? In other words, if I
stuff 2 tables in da1 without joining them, I believe I
can only reference one set of data in the adapter unlike a
dataset. Is this correct? So for Insert or Delete
operations I need one adapter per table?
Thanks,
Rich
My goal with the question is to make sure I'm not doing
this the hardest way possible. I have a dataAdapter (da1)
which I create in the formload event and I have 2 source
tables (tbl1 and tbl2) from a sql server which I join in
the da1 select command. Then I fill a table (t0) in a
dataset (ds1) with this set of data from the 2 source
tables. To add new data to the source tables (tbl1 and
tbl2) or to update the data in the source tables I create
2 additional Adapters (da2, da3) which add tables t1 and
t2 to ds1. da2 links to tbl1 and da3 links to tbl2. I
update the fields for tbl1 and call da2.Update(ds1, "t1"),
then I update the fields for tbl2 and call da3.Update
(ds1, "t2"). The other thing I tried was to reset the
selectcommand for da1 from the join sql to Select * from
tbl1 and then again da1.Update(ds1, "t1"), then change the
selectcommand to select * from tbl2...
The question is if I am being inefficient here or
overkill, or is this how it is done? In other words, if I
stuff 2 tables in da1 without joining them, I believe I
can only reference one set of data in the adapter unlike a
dataset. Is this correct? So for Insert or Delete
operations I need one adapter per table?
Thanks,
Rich