Q) re where to put SqlConnection on a C/S type app

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

I'm not sure where the most effcient place to put my main SqlConnection
object should be. The app's a typical windows form based client/server app.

Do I put the SqlConnection in my main application's class? Do I put one on
each form? The forms are modal but at somepoint that might change where
several forms are open at once.

Thanks.
bwolf at issgroup dot net
 
Bill, if you have connection pooling turned on, it's not really an issue
where you put it as long as you make sure you close the connection as soon
as you're done with it.
 
I'm not sure I need pooling. The app will have only a few dozen users
connected to SQL server. Actually a number of the users will be in remote
locations and be running standalone against a local copy of MSDE. SQL
replication will be used to synch to a central server.

In light of this, what's my best connection strategy in my app?

Thanks
 
Back
Top