473,624 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internal .Net Framework Data Provider error 1

Win2k3
IIS6
..NET 2.0

In my ASP.NET 2.0 app I create an open an SQL connection in the page's
constructor and call objSQL.Dispose( ) in the destructor. The SQLConnection
object is a class member of the page. Here's the destructor code:

/// Destructor
~Officer()
{
if( m_objConn != null )
m_objConn.Dispo se();
}
/// End Destructor
When running this particular page through some testing I get the following
exception in the destructor at the "m_objConn.Disp ose();" line:

System.InvalidO perationExcepti on was unhandled
Message="Intern al .Net Framework Data Provider error 1."
Source="System. Data"
StackTrace:
at System.Data.Pro viderBase.DbCon nectionInternal .PrePush(Object
expectedOwner)
at
System.Data.Pro viderBase.DbCon nectionPool.Put Object(DbConnec tionInternal
obj, Object owningObject)
at
System.Data.Pro viderBase.DbCon nectionInternal .CloseConnectio n(DbConnection
owningObject, DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Close()
at System.Data.Sql Client.SqlConne ction.Dispose(B oolean disposing)
at System.Componen tModel.Componen t.Dispose()
at Officer.Finaliz e() in c:\sys\projects \AddOfficer.asp x.cs:line 46

When I stop debugging VS2k5 pops up the JIT debugging dialog stating an
unhandled exception occurred in w3wp.exe.

1) Is this a bug?
2) Do I need a try/catch in a destructor? Is it good programming practice?
3) Why is this happening?
4) What is the meaning of life?
Any help is appreciated. TIA

Andrew
Apr 7 '06 #1
2 8122
You should never hold onto a connection for the life of a page. Open and
close the connection each time you need to. Let Connection Pooling work for
you.

Jeff

"Andrew" <andrew_test(do nt spam its not cool)@hotmail.c om> wrote in message
news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
Win2k3
IIS6
.NET 2.0

In my ASP.NET 2.0 app I create an open an SQL connection in the page's
constructor and call objSQL.Dispose( ) in the destructor. The
SQLConnection object is a class member of the page. Here's the destructor
code:

/// Destructor
~Officer()
{
if( m_objConn != null )
m_objConn.Dispo se();
}
/// End Destructor
When running this particular page through some testing I get the following
exception in the destructor at the "m_objConn.Disp ose();" line:

System.InvalidO perationExcepti on was unhandled
Message="Intern al .Net Framework Data Provider error 1."
Source="System. Data"
StackTrace:
at System.Data.Pro viderBase.DbCon nectionInternal .PrePush(Object
expectedOwner)
at
System.Data.Pro viderBase.DbCon nectionPool.Put Object(DbConnec tionInternal
obj, Object owningObject)
at
System.Data.Pro viderBase.DbCon nectionInternal .CloseConnectio n(DbConnection
owningObject, DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Close()
at System.Data.Sql Client.SqlConne ction.Dispose(B oolean disposing)
at System.Componen tModel.Componen t.Dispose()
at Officer.Finaliz e() in c:\sys\projects \AddOfficer.asp x.cs:line 46

When I stop debugging VS2k5 pops up the JIT debugging dialog stating an
unhandled exception occurred in w3wp.exe.

1) Is this a bug?
2) Do I need a try/catch in a destructor? Is it good programming
practice?
3) Why is this happening?
4) What is the meaning of life?
Any help is appreciated. TIA

Andrew

Apr 7 '06 #2
Thanks for the connection pooling tip. However in this case I'm not sure
how it's relevant. More detail on the cause of the error and whether
destructors should have exception handling code would be helpful.

Thanks,
Andrew

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:eK******** ******@TK2MSFTN GP02.phx.gbl...
You should never hold onto a connection for the life of a page. Open and
close the connection each time you need to. Let Connection Pooling work
for you.

Jeff

"Andrew" <andrew_test(do nt spam its not cool)@hotmail.c om> wrote in
message news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
Win2k3
IIS6
.NET 2.0

In my ASP.NET 2.0 app I create an open an SQL connection in the page's
constructor and call objSQL.Dispose( ) in the destructor. The
SQLConnection object is a class member of the page. Here's the
destructor code:

/// Destructor
~Officer()
{
if( m_objConn != null )
m_objConn.Dispo se();
}
/// End Destructor
When running this particular page through some testing I get the
following exception in the destructor at the "m_objConn.Disp ose();" line:

System.InvalidO perationExcepti on was unhandled
Message="Intern al .Net Framework Data Provider error 1."
Source="System. Data"
StackTrace:
at System.Data.Pro viderBase.DbCon nectionInternal .PrePush(Object
expectedOwner)
at
System.Data.Pro viderBase.DbCon nectionPool.Put Object(DbConnec tionInternal
obj, Object owningObject)
at
System.Data.Pro viderBase.DbCon nectionInternal .CloseConnectio n(DbConnection
owningObject, DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Close()
at System.Data.Sql Client.SqlConne ction.Dispose(B oolean disposing)
at System.Componen tModel.Componen t.Dispose()
at Officer.Finaliz e() in c:\sys\projects \AddOfficer.asp x.cs:line 46

When I stop debugging VS2k5 pops up the JIT debugging dialog stating an
unhandled exception occurred in w3wp.exe.

1) Is this a bug?
2) Do I need a try/catch in a destructor? Is it good programming
practice?
3) Why is this happening?
4) What is the meaning of life?
Any help is appreciated. TIA

Andrew


Apr 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2453
by: Jonathan Woods | last post by:
I could not find Oracle .NET data provider for version 1.1. Do I have to use ODBC .NET data provider for instead? Which provider can offer best access to Oracle Database? I'm using Oracle 8i. Thanks for any kind response.
2
1804
by: Doug | last post by:
We are using the .net framework data provider for SQL, but have hit a problem that we have not been able to solve regardless of the timeouts or conncetion pooling settings on the server. We more times than not get this error: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
10
2180
by: Paul Deibel | last post by:
Hello I am working on a VB.Net project where I need to change the data provider from OLEDB to OracleClient. I am also looking to use "shaping" and I am looking for the equivalent to "Provider=MSDataShape.1" when using an OracleClient connection string. The provider syntax works fine with an OLEDB Connection String. Does anyone know how to do this? I am using the 1.1 framework, and Visual Studio vb.net (Note ... I switched to...
0
1664
by: acwomble | last post by:
I am working with a database on another system via a ssh tunnel using plink. We have setup an alias the local system for the remote database. I am able to connect and work from within Visual Studio if I connect to the remote database using with "SQL Server" as the data source and ".NET Framework Data Provider for OLEDB" as the data provider . If I change the data provider to ".NET Framework Data Provider for SQL Server" I get the...
2
6181
by: bguthals | last post by:
Recieved the following error message. I'm not familiar with .Net and my co-workers haven't seen this error before. Maybe someone can clue me in on what is the problem. .Net SqlClient Data Provider: Database 'Mydatabase' is already open and can only have one user at a time.
7
2552
by: Peter Hann | last post by:
As far as I know VisualStudio contains a MS built-in data provider for accessing Oracle databases. Is this built-in MS data provider only in the "full" VisualStudio Edition or in the Express edition as well ? Can I download this built-in MS Data Provider for Oracle databases separately and/or re-install it somehow again ? Peter
1
5780
by: aj | last post by:
I'm trying to hook up some MS stuff to my DB2 LUW 8.2 FP14. Can anyone provide any guidance on .Net Framework Data Provider for DB2? Is there one? Where can I get it? I've been trawling thru microsoft.com and my eyes are crossing. The last time I did this sort of thing, ODBC was popular.. TIA
2
1944
by: Martin Racette | last post by:
Hi, I'm trying to make a programme that will use the above mentioned database, but I can not find how to create any relation between the tables, all there is in the database explorer is DATA CONNECTIONS DATABASE1.SDF TABLES REPLICATION
2
6101
by: Klaudiusz Bryja | last post by:
Hi I connect to Oracle 9.2 using System.Data.OracleClient. I call stored procedures and in cmd.ExecuteNonQuery I get error: "Internal .Net Framework Data Provider Error 30." StackTrace: in System.Data.ProviderBase.DbBuffer.Validate(Int32 offset, Int32 count)
0
8238
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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
8624
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
8336
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,...
1
6111
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
4082
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...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
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
2
1485
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.