Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dataadapter.fill
Message
From
03/05/2004 09:58:59
 
 
To
03/05/2004 09:47:44
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00900358
Message ID:
00900360
Views:
17
>In my application, I am using a data adapter, and I am filling it in code with dataadaptor.fill without using a connection.open and a connection.close. I assume the adapter does that myself. My question is whether or not this is a good practice or not. Does the connection always close?

Yes, this is a good practice. A .Fill() opens the connection if it's not already open and closes it only if it wasn't previously open. So, if you're going to filling more than one table you should open the connection first manually and then close it after the last .Fill(), but if you're only filling one DataSet, then don't bother with the open and close.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform