Hi dollar,
What I meant was, do not share a Connection. Open and clase your Connections
as quickly as possible. If they share the same Connection String, they will
be pooled and reused, without your having to do anything special, due to the
built-in Connection Pooling in .Net.
Another way to look at it is this: If you come from an ASP background, and
you're used to having to create and reuse a Connection in order to save
resources used when opening new Connections, you don't have to worry about
that any more. .Net has built-in Connection Pooling that, in a sense,
handles this for you. In fact, it is much safer and better to open and clse
each Connection as quickly as possible. When you close the Connection, you
release it to the Connection Pool. It is not destroyed immediately, but
pooled by the .Net platform.
Does that help?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"dollar" <do***********@mail.codecomments.com> wrote in message
news:do***********@mail.codecomments.com...
thanks for your reply Kevin, but I don't understand what do you mean to
"NOT to do that", you mean to declare the same connection and same
class in every web form ? and what is the built-in connection pooling ?
please describe it more detail , it is better to show me some simple
examples, thanks
Kevin Spencer wrote: [b]Hi dollar,
The best way is NOT to do that. Open and close database connections
as
quickly as possible, and let the built-in Connection Pooling handle
the
rest.
--
HTH,
Kevin Spencer
Microsoft MVP
...Net Developer
What You Seek Is What You Get.
--
dollar
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------