this isnt technical question on how to connect to SQL server i know how to connect to SQL server using connected and disconnected mode, but iam a Little confused on how many connection is created when multiple users is requesting data it seem all the user requesting the page use the same connection because if the connection was open and error happen all the users have error when open connection saying the connection is already open, what i need to know is how the connection work when multiple user is connected to my website, questions to be more clear on:-
1-why if one connection didnt get closed all the users who suppose to have diffident connection suffer same error?
2- if its only one connection used to the whole website that mean if user open connection he have to close it first before another user can use the connection even if use query take 30 minute?
thank you in advance,
Actually in ASP.NET, when you establish a connection, a connection pool is created..
this pool depends on your connection string..
I mean, as far as your connection string is same for every establishing connection, connections are taken from the same pool and dropped into the same pool once closed.
Even a single space difference in connection string will create a different connection pool.
you can specify the maximum and minimum connections for any pool, how long a connection should stay in pool befor its destroyed etc., in connection string..
If you don’t close any opened connections, it will go on creating new connections in pool and maximum poolsize will be reached and any further request will result in connection error