MS Access database remains open in ASP.NET?

W

WQ

Folks,

I am sure this is a simple one for you gurus. I am rather new to ASP.Net.
I have setup a connection string to an MS Access database using web.cfg.
Somehow, some component of ASP.Net keeps the database opened (I can see the
..ldb file) even when the user has physically logged off (session.abandon).
Ideally, I would like to achieve traditional ASP type environment, where the
connection opens only when the page is being processed.

I would appreciate your comments to fix my issue.

Thanks.

Walt.
 
J

Jay

Review your code to see if you are closing the database connection after
performing the necessary operations.

the best thing would be to implement a try{} catch{} finally{} block and in
the finally block
check for the following
// asuming cn is ur connection object name.

if(cn != null && cn.State != ConnectionState.Closed)
{
cn.Close();
}

hope this works for u.
Jay.
 

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