473,473 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

UnManaged Resource Identification

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
7 1549
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
5
by: Barry Anderberg | last post by:
I'm using a tool by Sci-Tech called the .NET Memory Profiler. We have a massive .NET/C# application here and it has been exhibiting memory leak behavior for some time. Attempting to remedy the...
6
by: Eric | last post by:
for example: SqlConnection is used in my project, how can I know if all connections were closed after open and execution. If some guys forget to close connections after using, how can i check it...
4
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
3
by: Steve | last post by:
I have former VC++ 6.0 application which was ported to .NET. Now we continue to develop this app under VS.NET. The app now contains both managed and unmanaged classes. Now I have a problem with...
4
by: Maxwell | last post by:
Hello, Newbie question here for disposing of unmanaged resources in MC++.NET. I have a managed VS.NET 2003 MC++ wrapper class that wraps a unmanaged C++ dll. What I am trying to figure out is...
9
by: Alf P. Steinbach | last post by:
<what to design a C++ solution for> A Windows API /resource/ is data embedded in the executable, accessed via API functions. A resource is completely identified by the quadruple (id, type,...
5
by: ttc | last post by:
Hi All, I have a managed class that inherits from an unmanged class. The question is, if the object of the manged class get garbage collected, will the memory be free automatically for me or...
1
by: George2 | last post by:
Hello everyone, I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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 project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.