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

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
 
W

William Ryan eMVP

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.
 
B

bill

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top