If you really wanted to, just use Connections.Connection[UserName]
. That returns the same SqlConnection
. However that will dispose it. Your pattern/design is flawed because ADO.NET has connection pooling.
You could also add your own wrapping object that implements IDisposable
.