I am building a Dll file for communication between a SQL server and a Asp.net website.
Basically im putting all calls to the SQl in this DLL file, contained in the following way.
Then i started to wonder, if this is the correct way to do it? First i Open the connection, then i do all my DB work, and then Close the connection, using the connectionstatus to determine if connection is open already.
In my mind i assume it would be correct because of only 1 connection to the DB, but is it better to actually open and close a connection for each idividual call to the DB?
My second problem is that, the website i use this DLL File with, is just 1 page, refresing every 5min thru the Ajax Updatepanel.
At the refresh of the page, it opens 1 connection to the DB retrieve all the info then close connection.
I Dispose all variables at end, but still my worker process on the server is at 46mb after 2-3 days running.
I hope someone can help me with the worker process or just give an idea how to do the DLL file in a better way.
Basically im putting all calls to the SQl in this DLL file, contained in the following way.
Code:
ClassName
- Connection
- OpenConnection
- CloseConnection
- ConnectionStatus
- Queue
- GetQueueId
- GetQueueCalls
- User
- GetFullName
- GetUserName
In my mind i assume it would be correct because of only 1 connection to the DB, but is it better to actually open and close a connection for each idividual call to the DB?
My second problem is that, the website i use this DLL File with, is just 1 page, refresing every 5min thru the Ajax Updatepanel.
At the refresh of the page, it opens 1 connection to the DB retrieve all the info then close connection.
I Dispose all variables at end, but still my worker process on the server is at 46mb after 2-3 days running.
I hope someone can help me with the worker process or just give an idea how to do the DLL file in a better way.