473,473 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

replacing system.data

Hi,
I would like to add some code to system.data so I can trace calls to
SqlConnection class. I used ildasm.exe, got the il code, added some of
mine and used the ilasm.exe to get a new assembly.

The problem is that I cannot remove the old file using the gacutil.exe
.... it says that it is required by other applications ...

How is it possible to remove system.data.dll from the gac or get my
task done in a different way?

Thanks,
Gilad.

Nov 26 '06 #1
7 1264
System.Data is core part of MS..NET Framework, you really cannot remove it
with removing whole .NET framework. The question is, why do yuo want to
remove it? Are you saying that you develop your own ".NET framework" and you
want to replace MS .NET framework with yours? Probably not. If you developed
something, which is based on System.Data/MS .NET framework (that is most
..NET development do), you do not throw those your product based on away, you
nedd them in order for your product to work. If your product is developed
correctly and ready to be placed into GAC, just place it in, and have your
other .NET projects to use it, rather than directly using System.Data (if
your stuff is indeed a replacement of System.Data, but I really doudt it,
sorry.).
"gilad" <gi****@yahoo.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Hi,
I would like to add some code to system.data so I can trace calls to
SqlConnection class. I used ildasm.exe, got the il code, added some of
mine and used the ilasm.exe to get a new assembly.

The problem is that I cannot remove the old file using the gacutil.exe
... it says that it is required by other applications ...

How is it possible to remove system.data.dll from the gac or get my
task done in a different way?

Thanks,
Gilad.

Nov 26 '06 #2
Hi Gilad,

It's a bad idea to replace System.Data.

Instead, create a class that wraps SqlConnection and trace the calls in
that. You'll have to use your wrapper class instead of SqlConnection
throughout your application:

public class TracedSqlConnection : DbConnection
{
private readonly SqlConnection connection;
private readonly string id;

public TracedSqlConnection(string id, string connectionString)
{
this.id = id;
this.connection = new SqlConnection(connectionString);
}

public override void Open()
{
System.Diagnostics.Trace.WriteLine("Calling Open()",
"TracedSqlConnection: " + id);

connection.Open();

System.Diagnostics.Trace.WriteLine("Open() called",
"TracedSqlConnection: " + id);
}

// TODO: remaining method implementations here
}

--
Dave Sexton

"gilad" <gi****@yahoo.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Hi,
I would like to add some code to system.data so I can trace calls to
SqlConnection class. I used ildasm.exe, got the il code, added some of
mine and used the ilasm.exe to get a new assembly.

The problem is that I cannot remove the old file using the gacutil.exe
... it says that it is required by other applications ...

How is it possible to remove system.data.dll from the gac or get my
task done in a different way?

Thanks,
Gilad.

Nov 27 '06 #3
thanks all. I'm actually looking for a general way to know which msil
are about to run, which classes, methods and in runtime update the code
so I can get notifications for start/end of methods I'm interested in.

When using third party, it is possible to use ildasm to get the il.
then update it and use ilasm to generate a new assembly. But when it is
system files ... like system.data it is a problem. I read about
profiling api but it has too much overhead and there can only be one
instance running.

Gilad.

Nov 27 '06 #4
Hi Gilad,

Out of curiousity, why do you want this functionality?

--
Dave Sexton

"gilad" <gi****@yahoo.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
thanks all. I'm actually looking for a general way to know which msil
are about to run, which classes, methods and in runtime update the code
so I can get notifications for start/end of methods I'm interested in.

When using third party, it is possible to use ildasm to get the il.
then update it and use ilasm to generate a new assembly. But when it is
system files ... like system.data it is a problem. I read about
profiling api but it has too much overhead and there can only be one
instance running.

Gilad.

Nov 27 '06 #5
I want to be able to give reports on some db products that we use - how
many connections they are using, time in db etc ... stuff to help
figure out some problems. To do this, I need to hijack some of the Sql
classes in the system.data.

I'm surprised there is not enough data on this issue. I'm sure I'm not
the first or the last that want to do this.

Gilad.

Nov 27 '06 #6
What's wrong with the Management tools that perfmon gives you for doing
this?

"gilad" <gi****@yahoo.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
>I want to be able to give reports on some db products that we use - how
many connections they are using, time in db etc ... stuff to help
figure out some problems. To do this, I need to hijack some of the Sql
classes in the system.data.

I'm surprised there is not enough data on this issue. I'm sure I'm not
the first or the last that want to do this.

Gilad.

Nov 27 '06 #7
Hi Gilad,

I agree with Paul's suggestion. There are performance counters for managed
and unmanaged code that can be viewed using the Performance Console utility
(perfmon) or directly in managed code using the PerformanceCounter class in
System.Diagnostics.

"PerformanceCounter Class"
http://msdn2.microsoft.com/en-us/lib...cecounter.aspx

"Runtime Profiling" (perfmon)
http://msdn2.microsoft.com/en-gb/lib...47(VS.80).aspx

Also, the RDBMS that you use will most likely provide proprietary tools for
viewing connectivity, information about transactions and other uses of the
system. Sql Server 2000 and Sql Server 2005 both supply administrative
tools for doing exactly that. One of the more useful tools, which is
separate from Enterprise Manager and the Sql Server Management Studio, is
the Sql Server Profiler.

"Using SQL Server Profiler"
http://msdn2.microsoft.com/en-us/library/ms187929.aspx

--
Dave Sexton

"gilad" <gi****@yahoo.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
>I want to be able to give reports on some db products that we use - how
many connections they are using, time in db etc ... stuff to help
figure out some problems. To do this, I need to hijack some of the Sql
classes in the system.data.

I'm surprised there is not enough data on this issue. I'm sure I'm not
the first or the last that want to do this.

Gilad.

Nov 27 '06 #8

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

Similar topics

13
by: yaipa | last post by:
What would be the common sense way of finding a binary pattern in a ..bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the...
7
by: Rob Meade | last post by:
Hi all, Been a long time since I've been here... /me waves to all.. Ok - my conundrum.. I have a form where a user can enter text and BB codes...for example:
2
by: thehuby | last post by:
Isn't inserting good data and getting it out of a db a pain in the a$$? I am going to be using the Markdown text to HTML parser (http://daringfireball.net/projects/markdown/dingus) for creating...
7
by: VMI | last post by:
If I have the string "Héllo", how can I replace char (é) with an 'e'? I cannot use the String.Replace() fuction. It has to be by replacing one char with another. Thanks.
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
2
by: James Fifth | last post by:
Hello and God Bless, I am stumped trying to get a simple xml database replacing certain data with other data programmatically. This is what my xml looks like. ...
2
by: David | last post by:
Sent this to alt.php a couple of days back, but doesn't look like I'll get an answer, so trying here. I'm trying to convert a script to use friendly URLs, I've done this before, but my PHP...
10
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL...
1
by: TamusJRoyce | last post by:
I have xsl code which I was hoping could be used to replace one specific tag from an xhtml document and output another xhtml document. xsl has phenomenal potential in data replacing, but coming...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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...
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
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 ...

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.