MS Access database remains open in ASP.NET?

  • Thread starter Thread starter WQ
  • Start date Start date
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.
 
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.
 
Back
Top