views:

41

answers:

3

hi

i have my C# program that work with sql-server 2008 Enterprise Edition

i have 40 users that connect to this database.

i dont close the connection.

how many open connection is recommended to leave ? or is it better to close connection ?

thank's in advance

+6  A: 

Always close your connections, so they can return to the connection pool.

Not doing so may cause the pool to empty up and no new connections will be available, so no new clients (or connections) will be able to connect to the database.

You really should ask yourself how many connections to configure on the connection pool. The optimal number will vary. (Thanks for the comment, Henk).

Oded
Absolutely. But that shifts the question to: How many connections should each of my ConnectionPools have?
Henk Holterman
@Henk Holterman - Fair comment. I added a link to a relevant question.
Oded
er.. 40 users implies 40 different client machines implies 40 different connection pools. It's not that critical if there is one app per client device connecting to the server. A web server, yes, this is different but not WinForms etc
gbn
+3  A: 

This is like asking how many faucets and lights you can have on in your house simultaneously. Turn them off!! :)

Pierreten
+1  A: 

In general you can set this value in the connection string "Max Pool Size and Default value is 100"

This is an interested article: Connection pool myths

Any way, your application should close connections to release resources.

igor