Each time my application runs a saved procedure it will something similar to this:

using (DbBase conn = new DbBase())
    //call sproc

the DBBase() opens the bond having a LINQ DataContext.

Things I desired to know, if there's a method to determine if an association was already opened up, and employ that rather than opening a replacement. That verification ought to be done within the DbBase() constructor that goes such as this:

ClientDB = new ClientDBDataContext([ConnectionString from web.config]);


You consider the [cde] property associated with a State object, and it'll let you know whether it's open, closed, connecting, executing, fetching or broken.

Through the use of the DBConnection statement though, you are guaranteed the connection has been closed once the object is out of scope.

The excellent factor about using using{ } is this fact is the kind of factor you don't have to be worried about.

I would not be worried about it (unless of course you've profiled it or something like that). With connection pooling, opening a brand new connection can be quite cheap. If there's an issue then you might like to take a look at altering the amount of connections within the pool (http://www.15seconds.com/problem/040830.htm)

I'm not sure about DBase, however the Sql Server provider a minimum of already performs this for you personally. It uses connection pooling without anyone's knowledge to re-use existing connections where possible.

With connection pooling in position (The default - unlkess you've clearly done something to power it down) this isn't an problem. Allow the connection pooling code handle this. Closing the bond then, really only releases it to the pool to become used again. Only when you will find none within the pool will a replacement get produced (and opened up) for you personally. Good you're while using using statement. This guarantees the conection is going to be launched to the pool for reuse (NOT closed) as doon because this code snippet is performed by using it.