L
LouieG
Very simply, I have a strongly typed dataset and I want to fill more than
one data table at a time.
Sending 8 requests each with one query to my SQL server is much less
efficient than if I could send all 8 queries with one request. SQL has no
problem handling this and I would have thought that the data adapter would
be intelligent enough to know that results from 'select * from MyTable'
should fill 'MyTable' in my strongly typed dataset and results from 'select
* from MyTable2' should fill 'MyTable2' . The fill method of the
dataadapter can either fill the dataset itself or can specify ONE specific
strongly typed datatable, but what about 2 or 3 or 4 of them?
Is there a way to accomplish this?
Something like:
strSQL = "multiple sql queries"
cmdSQL = new sqlCommand(strSQL, MyOpenConnection)
daSQL = new sqldataadapter(cmdSQL)
daSQL.Fill(MyStronglyTypedDataset)
Thiscontrol.datasource = MyStronglyTypedDataset.MyTable1
ThisOthercontrol.datasource = MyStronglyTypedDataset.MyTable2
ThisThirdcontrol.datasource = MyStronglyTypedDataset.MyTable3
One trip to the SQL server, as many tables worth of results as I need.
one data table at a time.
Sending 8 requests each with one query to my SQL server is much less
efficient than if I could send all 8 queries with one request. SQL has no
problem handling this and I would have thought that the data adapter would
be intelligent enough to know that results from 'select * from MyTable'
should fill 'MyTable' in my strongly typed dataset and results from 'select
* from MyTable2' should fill 'MyTable2' . The fill method of the
dataadapter can either fill the dataset itself or can specify ONE specific
strongly typed datatable, but what about 2 or 3 or 4 of them?
Is there a way to accomplish this?
Something like:
strSQL = "multiple sql queries"
cmdSQL = new sqlCommand(strSQL, MyOpenConnection)
daSQL = new sqldataadapter(cmdSQL)
daSQL.Fill(MyStronglyTypedDataset)
Thiscontrol.datasource = MyStronglyTypedDataset.MyTable1
ThisOthercontrol.datasource = MyStronglyTypedDataset.MyTable2
ThisThirdcontrol.datasource = MyStronglyTypedDataset.MyTable3
One trip to the SQL server, as many tables worth of results as I need.