Asp.net fails to connect to access db after a while

M

mark

My asp.net app fails to make any further connections to
my access db after surfing for a while. This error also
brings down the entire site for all other users as well.
Made sure to close all connections and even call dispose
when done. Access lock remains for a while. The file
size of the access db grows from about 500k to 2.5 mb
after browsing the site for a couple of minutes. I'm
using forms authentication with a login script. Never
ran into this problem with the same type of access db
with asp 3.0 web applications. Just recently started
using asp.net. Please help!
 
T

Tohid

Did you "close" and "dispose" the "OledbDataReader" and/or "DataAdaptor" in
you behinde code?
Check it first.
 
M

mark

Yes, I close the datareader. I don't see a dispose method
for the reader though. I really can't see what would be
causing this. Here's a example of how I'm opening and
closing my database:
Public Function getCatname(ByVal catID As String)
Dim myConnection As OleDbConnection = New
OleDbConnection(ConfigurationSettings.AppSettings
("ConnectionString"))
Dim myCommand As OleDbCommand = New
OleDbCommand("qCatName", myConnection)
myCommand.CommandType =
CommandType.StoredProcedure

Dim parameterProductID As OleDbParameter = New
OleDbParameter("catID", OleDbType.VarChar, 50)
parameterProductID.Value = catID
myCommand.Parameters.Add(parameterProductID)

Try
myConnection.Open()
Dim rs As OleDbDataReader =
myCommand.ExecuteReader
Dim catName As String
While rs.Read
catName = rs("CATEGORY")
End While
rs.Close()
Return catName
myCommand.Dispose()
myConnection.Close()
myConnection.Dispose()
myConnection = Nothing
Catch
Return Nothing
End Try
GC.Collect()
End Function

I'm using Access 2000 by the way. Thanks for the info.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top