473,395 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2836
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob Rosen | last post by:
Based on the information I have now, the answer would seem to be No. Does anyone have information to the contrary? Here's the problem. On my first attempt to display a report, Crystal...
1
by: Job Lot | last post by:
I have written the following function which returns OleDbConnection object. If global variable g_strDbPath contains an invalid file name or path name the catch block throws an error with...
0
by: ecowalker | last post by:
Hello, I've try the following code in the ASPX and it throw a Security Exception in the runtime, but I've try to run on my colleagues machine without any problem. I am using XP Pro and IIS5.1...
1
by: Lilly | last post by:
Hi all. I'm really sorry for this post, I'm sure most of you will think it's a silly question, but the following doesn't work and I'm really new to ASP.NET: <%@ Page Language="C#" %> <%@...
3
by: Mullin Yu | last post by:
As subject, if the sp returns a recordset, i can use OlbDbAdapter to get it, but how about just a return value from sp, e.g. 0 - successful; 1 - error like lter proc UpdateJobItemStatus...
3
by: Ludvig | last post by:
This Exception is executed when using SQLConnection. OleDbConnection connects fine. System.EnterpriseServices.Platform.Initialize() +503...
2
by: Curt tabor | last post by:
Hi, I have several pages in my app that all use the same oleDBConnection(s). When this connection gets created, I store it as a Session variable so that other pages can access it w/o having...
2
by: Marcel Hug | last post by:
Hello NG ! I would like to open a MS Access Db by C#. I use the following code: string strConnectionText = @"Provider=Microsoft.Jet.OLEDB.4.0; Data...
4
by: tamarindm | last post by:
I am using the following to connect to a Sybase server. OleDbConnection Conn= new OleDbConnection(); string connstr = "Provider=Sybase ASE OLE DB Provider;Data Source=SERVER;User...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.