473,803 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 myDataReaderCon nection = new
OleDbConnection (Constants.CONN ECTION_STRING);
Line 77: OleDbCommand myDataReaderCom mand = new OleDbCommand(my SelectQuery,
myDataReaderCon nection);
Line 78: myDataReaderCom mand.Connection .Open();
Line 79: dbReader =
myDataReaderCom mand.ExecuteRea der(CommandBeha vior.CloseConne ction);
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 2879
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*****@hotmai l.com> wrote in message
news:ut******** ******@TK2MSFTN GP11.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 myDataReaderCon nection = new
OleDbConnection (Constants.CONN ECTION_STRING);
Line 77: OleDbCommand myDataReaderCom mand = new
OleDbCommand(my SelectQuery,
myDataReaderCon nection);
Line 78: myDataReaderCom mand.Connection .Open();
Line 79: dbReader =
myDataReaderCom mand.ExecuteRea der(CommandBeha vior.CloseConne ction);
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.mach in AT dot.state.fl.us > wrote
in message news:%2******** **********@TK2M SFTNGP11.phx.gb l...
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*****@hotmai l.com> wrote in message
news:ut******** ******@TK2MSFTN GP11.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 myDataReaderCon nection = new
OleDbConnection (Constants.CONN ECTION_STRING);
Line 77: OleDbCommand myDataReaderCom mand = new
OleDbCommand(my SelectQuery,
myDataReaderCon nection);
Line 78: myDataReaderCom mand.Connection .Open();
Line 79: dbReader =
myDataReaderCom mand.ExecuteRea der(CommandBeha vior.CloseConne ction);
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
1871
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 displayed a login prompt even though the (Access) database was unsecured. According to http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20544428.html, this is due to a problem that Crystal has when using a connection based on the OLEDB Jet...
1
2166
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 appropriate error message, but if g_strDbPath is blank then the catch block throws an error saying “No error information available: DB_SEC_E_AUTH_FAILED(0x80040E4D).” In this case connection string is incorrect so why doesn’t it throws as appropriate...
0
1237
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 , I've recently change the file system from FAT32 to NTFS, is is the matter of NTFS security issue or something else?
1
7242
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#" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> <script runat="server">
3
7104
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 @JobItemID as bigint, @Status as int as BEGIN Begin Tran -- Fail => locked, release locked, increase NoOfFailure
3
1797
by: Ludvig | last post by:
This Exception is executed when using SQLConnection. OleDbConnection connects fine. System.EnterpriseServices.Platform.Initialize() +503 System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb) +11 System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797 System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl ctrl) +170
2
1712
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 recreate new connections every time they load. I noticed during development that when ever the app first started, the connection would not be in Session when I navigvated to a page that used it. But with subsequent calls everything would be fine and...
2
1681
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 Source=C:\SWDev\My_Programs\Controller\DataBase\Test.mdb"; OleDBConnection dbConnection = new OleDBConnection(); dbConnection.ConnectionString = strConnectionText; dbConnection.Open();
4
8663
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 ID=USER;Password=password;database=DB"; Conn.Open(); I get the following error. What could be the problem ?
0
9700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10546
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.