473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

error handling through delegates..

hi all,
I dont know if this is possible or not, but what i want to do is specify
a delegate for an exception

for example iam trying to create a xml document like

Dim objDoc As New XmlDocument
Dim elem As XmlElement = objDoc.CreateElement("some element")
elem.InnerText = " some < "
objDoc.AppendChild(elem)

this will throw an xml exception, i want to declare a delegate which can
handle this, correct the text, so that the document creation can go on...

may be it is possible through some other idea ..,

any help/pointer will be appreciated
TIA
-ashish

Nov 20 '05 #1
1 904
No, you can't have a function get called when a specific exception occurrs.

You can put a Try/Catch around your code, catch an xmlexception, and then
call your method from there (though at this point, nothing in the try block
after the line where the exception was thrown would run).

"Ashish" <as*****@mailmenot.com> wrote in message
news:Or**************@TK2MSFTNGP09.phx.gbl...
hi all,
I dont know if this is possible or not, but what i want to do is specify
a delegate for an exception

for example iam trying to create a xml document like

Dim objDoc As New XmlDocument
Dim elem As XmlElement = objDoc.CreateElement("some element")
elem.InnerText = " some < "
objDoc.AppendChild(elem)

this will throw an xml exception, i want to declare a delegate which can
handle this, correct the text, so that the document creation can go on...

may be it is possible through some other idea ..,

any help/pointer will be appreciated
TIA
-ashish

Nov 20 '05 #2

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

Similar topics

13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
2
by: Marinos Christoforou | last post by:
Sorry if this has been asked before but as an inexperienced wanna-be C# programmer I wondering how to code classes to help build a standard Windows UI. For example to build a common toolbar. I...
2
by: Eric Newton | last post by:
VB's more declarative nature of handling events is golden. I'm hoping C# will acquire this type of deal, in addition to the anonymous delegates. could do same as vb (actually would be easier to...
2
by: Jonathan Rea | last post by:
Hello, Any help on the below would be much appreciated. I have an application which is rapidly getting larger and is event driven. i was wondering if anyone knew any good tutorials out there...
17
by: ahaupt | last post by:
Hi all, I'm currently writing a load of class libraries, but not the main application iteslf. I want to provide some method for reporting errors back to the main application. At the moment...
5
by: Paul Bromley | last post by:
For some time now I have been struggling trying to understand how to handle events originating in a User Control that I have designed when using this in an application. Basically I need to respond...
23
by: melon | last post by:
Hello, Is there anyway to force the application to handle the Red X button differently? I cannot use a generic Closing event as it will prevent the system to shut down properly. I hope that,...
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
9
by: MrDeej | last post by:
Hello guys! We have an SQL server which sometimes makes timeouts and connection errors. And we have an function witch writes and updates data in 2 tables on this server. When the SQL server error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.