I have two separate databases that my .Net application needs to connect to (it's a Windows application, not a web app). It needs to be able to connect to both at the same time, so I'm looking for a way to limit the connection to each database to just one connection per database (thus preventing the application from opening a second connection to either of the databases).
I've played with the Singleton pattern, but that doesn't seem to work as i want it due to the nature of it only allows one connection at a time, regardless of how many databases you have. This could work, but I feel it would be more efficient to have one connection per databases, but no duplicate connections to either database.
Suggestions??
I've played with the Singleton pattern, but that doesn't seem to work as i want it due to the nature of it only allows one connection at a time, regardless of how many databases you have. This could work, but I feel it would be more efficient to have one connection per databases, but no duplicate connections to either database.
Suggestions??