By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

UnManaged Resource Identification

P: n/a
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(strConnectionStr ing);
is a call to an unmanaged resource

thanks in Advance

thomson

Feb 1 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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;
}
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(strConnectionStr ing);
is a call to an unmanaged resource

thanks in Advance

thomson

Feb 1 '06 #2

P: n/a
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 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;
}
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(strConnectionStr ing);
is a call to an unmanaged resource
thanks in Advance

thomson

Feb 1 '06 #3

P: n/a
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!
***************************
"thomson" wrote:
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(strConnectionStr ing);
is a call to an unmanaged resource

thanks in Advance

thomson

Feb 1 '06 #4

P: n/a
Hello :)

"Eric Pearson" <www.geekswithblogs.com/ericpearson> schreef in bericht
news:e3**************************@msnews.microsoft .com...
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 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;
}
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(strConnectionStr ing);
is a call to an unmanaged resource
thanks in Advance

thomson


Feb 1 '06 #5

P: n/a
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

Feb 2 '06 #6

P: n/a
well, what is the end goal? Everything will eventually call into unmanaged
code. Are you looking more for code access security-related answers?

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

Feb 2 '06 #7

P: n/a
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

Feb 3 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.