Reputation: 62434
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
Upvotes: 2
Views: 273
Reputation: 5756
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.
Upvotes: 1
Reputation: 498992
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).
Upvotes: 6
Reputation: 10147
This is like asking how many faucets and lights you can have on in your house simultaneously. Turn them off!! :)
Upvotes: 3