470,636 Members | 1,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

OleDbConnection problem

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

Nov 17 '05 #1
2 2727
Hi,

I think it's related to concurrence accesing the DB,what if you put a
try/catch in the method you will get the exception, IIRC you will have to
check the InnerException or the NativeError , I dont remember right now the
correct one.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Grant" <gp*****@hotmail.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
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

Nov 17 '05 #2
Thanks for the reply Ignacio. The thing is I created a form application that
connects to the same database and it connects fine. When I create a
connection and check its status it is closed and I can open a new connection
with no errors and transactions work without error.

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2******************@TK2MSFTNGP11.phx.gbl...
Hi,

I think it's related to concurrence accesing the DB,what if you put a
try/catch in the method you will get the exception, IIRC you will have to
check the InnerException or the NativeError , I dont remember right now
the correct one.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Grant" <gp*****@hotmail.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
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


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Job Lot | last post: by
reply views Thread by ecowalker | last post: by
3 posts views Thread by Ludvig | last post: by
2 posts views Thread by Curt tabor | last post: by
2 posts views Thread by Marcel Hug | last post: by
4 posts views Thread by tamarindm | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.