Connection Object

  • Thread starter Thread starter Harini
  • Start date Start date
H

Harini

Which is the best way of programming?
Haveing a global connection object and using that
connection object in all the Forms.
Or
Openning a new connection in every form?

Becase some people say that because of connection pooling
ever thime You create a new instance it need not be a
new instance, the old connection is being used.

If sombody can point out a related article or give
clarification regarding this is appriciated.Thanks Harini.
 
I sent you a few links..but the bigger question from the Pool's pov is that
1) Close the connection as soon as you are done with it 2) The connection
string is the same.

I've heard all that noise about having only one centralized connection, but
I think it dubious in most implementations. If you Declare and Instantiate
a connection locally on a form or you Declare it globally and instantiate it
locally on the form... it pales in comparison to when you close it and if
you use the same connection strings.

HTH,

Bill
 
Back
Top