473,549 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exception GetType

Hi

What is the purpose of exception.GetTy pe and what are the possible values
returned by it? Can it for example tell me if the exception is of type
DBConcurrencyEx ception?

Thanks

Regards
Mar 15 '08 #1
1 4317
"John" <in**@nospam.in fovis.co.ukschr ieb
Hi

What is the purpose of exception.GetTy pe and what are the possible
values returned by it? Can it for example tell me if the exception
is of type DBConcurrencyEx ception?
GetType is inherited from Object. It returns the System.Type object
representing the instance type of the object. To check for a certain
type, use the TypeOf keyword (if typeof ex is DBConcurrencyEx ception
then). If you want to catch different types of exceptions and handle
them differently, you can write:

try

catch ex as DBConcurrencyEx ception
'...
catch ex as WhateverExcepti on
'...
catch ex as exception
'...
end try
Armin

Mar 15 '08 #2

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

Similar topics

3
3836
by: Jasleen | last post by:
I want to access the protected member hresult of the Exception class, so I derived my own class from ApplicationException and SystemException. public class LoggedException : SystemException { public LoggedException() : base() { } public LoggedException(String message) : base (message)
40
13475
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
11
19170
by: Matt | last post by:
I have written a console application that runs as a batch job on Windows 2000 Server. Every once in a while I am getting an exception thrown to the console. Is there a way I can create a global handler that can catch this exception and prevent the application from locking up? I am performing try catch statements at all database and file...
2
11143
by: Newbie | last post by:
Im getting an exception: System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at System.Data.Common.Int32Storage.Set(Int32 record, Object...
8
1378
by: Jonah Olsson | last post by:
Hi guys, For my VB.NET application, I created an ErrorHandler class that should save all available information about the last error occurred. I use Server.GetLastError for this. The problem is that I quite often get errors that I really can't say why they happen because of the lack of information from GetLastError. This is an example: ...
7
1698
by: ZorpiedoMan | last post by:
Well, I'm still wondering around in the "land of the lost exception"... It seems that controls that are bound to a class and the class throws an error in the SET method of the bound member, the exception cannot be caught. I have wrapped my entire application in all the global exception handlers I can find, and still to no avail. In fact all...
0
1227
by: ECathell | last post by:
I am getting an ambiguous matche exception on a piece of code and I dont know why. I have a similar property setup that runs just fine.... This Property runs fine. -------------------------------------- #Region "PrePack Enumeration" Public Enum PrePackTypes ICEPACK TRAYPACK End Enum ' Private mPrepack As Boolean
4
2159
by: jay.meerdink | last post by:
I have a simple app that opens in Program.cs with try { Application.Run(new Shell()); } catch (Exception ex) { LogErr(ex) }
3
6421
by: vainstah | last post by:
Hello Guys and Galls, To start off, I have reached the solution I was looking for, but I would like comments and feedback on the solution I have reached and tips/tricks on making it more elegant. I am not satisfied with the underlying machinery of the solution though. I am an advanced C programmer and most do object-based programming in C++....
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7450
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
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 we have to send another system

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.