|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Efficient Filling Multiple DataTablesHi 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. -- John 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. -- Show quoteMiha 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" <Jthayer@online.nospam> wrote in message news:835853E5-0F79-4784-912C-17870B2490E0@microsoft.com... > 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. > > -- > John Thanks Miha. Both great ideas.
-- Show quoteJohn "Miha Markic [MVP C#]" wrote: > 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" <Jthayer@online.nospam> wrote in message > news:835853E5-0F79-4784-912C-17870B2490E0@microsoft.com... > > 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. > > > > -- > > John > > > |
|||||||||||||||||||||||