SqlConnection is a sealed class with no factories, so overrides are not
possible. using delegation (host an internal sqlconnection, reader,etc) you
could make your own sql class library.
if you impersonate fred and open the connection, then return it to the pool
(via close). when sam comes alongs, and gets a connection out of the pool, it
may be freds. to sqlserver he will look like fred.
to get around this, just make use of the fact that connection pools use the
connect string as a key. if you include fred in the connection string, then
other users will not get one of freds pool connections (as they use a
different pool). you can use the username parameter, because with a trusted
connection, this parameter is ignored.
-- bruce (sqlwork.com)