VS 2005 Connections (1 Viewer)

WindSailor

Registered User.
Local time
Today, 05:58
Joined
Oct 29, 2003
Messages
239
Hello,

In VS 2003 you more or less manually opened, closed all of your connections.
In VS 2005 (going with the very basic idea of dragging a dataset from the Data Source tab onto a blank new form) I didn’t have to manually open the connection, and the connection is there for my data source… and I am able to update back to the database etc. (from another private sub) which is just weird for me… anyone care to expand why this is enabled this way? I guess I am confused on how long the connection is going to remain open… and the correct way to dispose of it.
I could manually open and dispose of connections in certain events which is fine, but would a VS 2005 application by default be opening another connection when the form loads?

I have read using VS 2003 you would open the connection first and then fill your adapter, so you wouldn’t be opening the connection twice, does this still apply with VS 2005?

I haven’t used connection pooling in the past, read about it, sounds good.
The most interesting part I read is that in ASP.net applications the connection pooling resides on the server, and in winform applications it lies on the client…ok what’s up with that? I can read a lot of different things into that… are they simply talking about on a server application the connection pooling resides on the server, and on a local database application it resides on the local machine?

---Edit ---
Re-worded the question...
 
Last edited:

pono1

Registered User.
Local time
Today, 05:58
Joined
Jun 23, 2002
Messages
1,186
Hi, Windsailor,

Connection pooling happens transparently (depending on the data provider) even when using VS 2003. As you know, as the developer, pooling or not, you are nevertheless still responsible for opening and closing all of your connections even if the pool object might not immediatley act on your commands. I have worked with the Oracle data provider and connection pooling. The default -- I think -- in the Oracle provider is for at least one connection to always remain open -- you can, however, tweak the pool behavior by assigning values to optional pool parameters in your connection string. I haven't dug into the Microsoft SQL Server provider, though. Do you, by chance, have any good links?

Regards,
Tim
 

WindSailor

Registered User.
Local time
Today, 05:58
Joined
Oct 29, 2003
Messages
239
Hi Tim,

The few links I have on connection pooling I have recently found are:

http://msdn2.microsoft.com/en-us/library/ms254502.aspx

http://www.ondotnet.com/pub/a/dotnet/2004/02/09/connpool.html

http://www.sql-server-performance.com/sk_connection_pooling_myths.asp

http://www.codeproject.com/Purgatory/ConnectionPooling.asp
-read comments below article-

http://www.datadirect.com/developer/net/connection_pooling/index.ssp

Thanks for the reply. When I get some free time I will dig into this a little deeper, and I definitely plan on using it.

Thanks,
Rick
 

pono1

Registered User.
Local time
Today, 05:58
Joined
Jun 23, 2002
Messages
1,186
Thank you for posting those links.

Regards
Tim
 

Users who are viewing this thread

Top Bottom