RE: OleDbConnection and MultiThreading

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Saurabh Nandu (SaurabhNandu_at_discussions.microsoft.com)
Date: 07/14/04


Date: Wed, 14 Jul 2004 07:08:05 -0700

The call to Dispose will automatically close the connection. Also there is a limitation in the current version of ADO.NET that you can have only 1 open DataReader per connection object.

-- 
Regards,
Saurabh Nandu
AksTech Solutions, reflecting your needs...
[ www.AksTech.com ]
[ www.MasterCSharp.com ]


Relevant Pages

  • Re: VS2005 and SQL Express: Internal .Net Framework Data Provider
    ... connection object you use. ... public void CreateConnection{ ... // Close first and dispose the existing data reader is there ... release resources used by the object ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: C# and GDI Resources
    ... interface use unmanaged resources; i.e. they end up being a wrapper to ... The rule is, if the object has a Dispose or Close method, make SURE you ... your class opens a database connection when an object is instanciated ... method would make sure to Dispose the database connection. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SqlConnection.Dispose close connection?
    ... The fact is that the garbage collector in c# is a generational collector. ... But a connection could be kept for longer use of course; ... Dispose calls Close anyway. ... By doing so you ensure that the unmanaged resource (i.e., ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 2 ways to close a connection
    ... that the fix did not come from calling dispose instead of close. ... > resources used by the object. ... It only closes the connection. ... > Explicitly disposing any object that uses unmanaged resources as soon as you ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Connection pooling...
    ... Lets say your class is "C" and the expensive objects it holds are A and B ... Dispose, and B was say an instance of a COM object. ... In that sense, calling dispose on a Connection object, does NOT Guarantee ... (WHEEZE COUGH COUGH!!) ...
    (microsoft.public.dotnet.framework.adonet)