Efficient Filling Multiple DataTables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I am transitioning from ADO.NET 1.1 to 2.0. One of my 1.1 practices when
filling a dataset with several related datatables was to
explicitly open the connection,
call fill for each dataAdapter involved,
explicitly close the connection.
This saved the overhead of the connection opening and closing for every
dataAdapter.Fill.
In 2.0, if I fill via TableAdapters, this approach could get pretty
convoluted. Is it worth pursuing? Any known examples of an efficient
approach to this situation?
Thanks.
 
You could specify many selects into a single dataadapter and map the results
to proper tables.
Or assign the same connection instance to all the tableadapters involved.
 
Thanks Miha. Both great ideas.
--
John


Miha Markic said:
You could specify many selects into a single dataadapter and map the results
to proper tables.
Or assign the same connection instance to all the tableadapters involved.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

JT said:
Hi all,
I am transitioning from ADO.NET 1.1 to 2.0. One of my 1.1 practices when
filling a dataset with several related datatables was to
explicitly open the connection,
call fill for each dataAdapter involved,
explicitly close the connection.
This saved the overhead of the connection opening and closing for every
dataAdapter.Fill.
In 2.0, if I fill via TableAdapters, this approach could get pretty
convoluted. Is it worth pursuing? Any known examples of an efficient
approach to this situation?
Thanks.
 
Back
Top