G
Guest
Hello folks,
i am searching at this forum, but i don't found a solution.
I try to fill two tables of a strong typed dataset by
ONE call of fill-Method of the dataadapter. Is there
any possibily to do this?
Table Customer contents name, titel ... primary key is IDCustomer
Table Adresses contents street, city ... primary key is IDAdress
I have a join table with foreign keys into
Table Adress2Customer content CustomerID and AdressID
I generate a dataadapter with the following select statement
select * from Adress2Customer inner join Adresses
on Adresses.IDAdress = Adress2Customer.AdressID
where Adress2Customer.CustomerID = 1234
to get all adresses from Customer 1234
At the moment I use 2 statements with different select parts
select Adresses.* and select Adress2Customer.*
and two dataadapters to fill my dataset.
OleDbDataAdapter1.Fill(myDataSet, "Adresses")
OleDbDataAdapter1.Fill(myDataSet, "Adress2Customer")
I expect this style of reading dta force two querys running at
the database.
Because of the size of the Tables it is impossible to read all data into
memory to etablish the relationship there.
Is there any possibily to avoid the second database reading?
Is there a way to fill two tables of a dataset from one sql-Statement?
Thanks in advance for any help.
Niels
i am searching at this forum, but i don't found a solution.
I try to fill two tables of a strong typed dataset by
ONE call of fill-Method of the dataadapter. Is there
any possibily to do this?
Table Customer contents name, titel ... primary key is IDCustomer
Table Adresses contents street, city ... primary key is IDAdress
I have a join table with foreign keys into
Table Adress2Customer content CustomerID and AdressID
I generate a dataadapter with the following select statement
select * from Adress2Customer inner join Adresses
on Adresses.IDAdress = Adress2Customer.AdressID
where Adress2Customer.CustomerID = 1234
to get all adresses from Customer 1234
At the moment I use 2 statements with different select parts
select Adresses.* and select Adress2Customer.*
and two dataadapters to fill my dataset.
OleDbDataAdapter1.Fill(myDataSet, "Adresses")
OleDbDataAdapter1.Fill(myDataSet, "Adress2Customer")
I expect this style of reading dta force two querys running at
the database.
Because of the size of the Tables it is impossible to read all data into
memory to etablish the relationship there.
Is there any possibily to avoid the second database reading?
Is there a way to fill two tables of a dataset from one sql-Statement?
Thanks in advance for any help.
Niels