UnManaged Resource Identification

  • Thread starter Thread starter thomson
  • Start date Start date
T

thomson

Hi All,
Connecting to SQL Server we say its an Un Managed
connection Can any one tell me whether this statement


objConnection = new
System.Data.OleDb.OleDbConnection(strConnectionString);


is a call to an unmanaged resource

thanks in Advance

thomson
 
The call to that constructor is not...

USING the object (such as calling "Open") will use unmanaged resources, calling
into odbc32.dll.



public OdbcConnection(string connectionString)
{
this.state = ConnectionState.Closed;
this.connectionTimeout = 15;
this.supportedSQLTypes = 0;
this.testedSQLTypes = 0;
this._dbcWrapper = new DBCWrapper();
GC.SuppressFinalize(this);
this.ConnectionString = connectionString;
}
 
sorry sent that too soon...

wanted to add a quick note... in case you havn't used Reflector before, it's
a REALLY handy decompiler. Any time you want to see exactly what the framework
is doing under the hood, pull up reflector and just look at the "code".

http://www.aisto.com/roeder/dotnet/
 
The code you have is managed, but it will ultimately work down into interop
and use unmanaged resources. This is why you should ALWAYS call dispose on
connection objects after you are through with them.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Hello :)

Eric Pearson said:
sorry sent that too soon...

wanted to add a quick note... in case you havn't used Reflector before,
it's a REALLY handy decompiler. Any time you want to see exactly what the
framework is doing under the hood, pull up reflector and just look at the
"code".
http://www.aisto.com/roeder/dotnet/
 
Hi All,
Alright i agree the point the code which i have
written is a managed one, inturn it will call the interop, But how will
i come to know that an interop is used, infact in one of the previous
post it is mentioned that using reflector you will be able to identify,
i used reflector, but not able to identify, Can any suggest how do i
approach this

Thanks in Advance

thomson
 
well, what is the end goal? Everything will eventually call into unmanaged
code. Are you looking more for code access security-related answers?
 
No ,
i do have problem with connection pooling , Some of the
connections are not getting closed , So Connection Pooling must be an
unmanaged kind, So i have to solve this, I need to identify whether iam
using Dispose() correctly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top