My C# web application connects to an Access database using the
OleDbConnection and OleDbDataReader.
I have 3 other computers that connect to this server but very frequently I
get an 'Unspecified error' message and the site becomes unusable. I have
customErrors set to 'Off' so I can see what bit of code it is crashing at
and it is always at line 78 below. (If I try and start a debug session - the
server seems to reset itself and goes back to normal so i cant tell why its
crashing there.)
----------------------------------------------------------------------------------------------------
Line 76: OleDbConnection myDataReaderConnection = new
OleDbConnection(Constants.CONNECTION_STRING);
Line 77: OleDbCommand myDataReaderCommand = new OleDbCommand(mySelectQuery,
myDataReaderConnection);
Line 78: myDataReaderCommand.Connection.Open();
Line 79: dbReader =
myDataReaderCommand.ExecuteReader(CommandBehavior. CloseConnection);
Line 80: return dbReader;
----------------------------------------------------------------------------------------------------
I think it has something to do with the APSNET user, because when I look at
'Processes' under Task Manager and kill 'Aspnet_wp.exe' - the website is
usable again and all functionality is restored to normal.
I have tried setting the session state timeout in IIS to 3 minutes in the
hope that it will kill that process but it didnt help at all.
Does anyone know how I can resolve this?
Thanks for any help,
Grant