473,395 Members | 1,692 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,395 software developers and data experts.

exception GetType

Hi

What is the purpose of exception.GetType and what are the possible values
returned by it? Can it for example tell me if the exception is of type
DBConcurrencyException?

Thanks

Regards
Mar 15 '08 #1
1 4307
"John" <in**@nospam.infovis.co.ukschrieb
Hi

What is the purpose of exception.GetType and what are the possible
values returned by it? Can it for example tell me if the exception
is of type DBConcurrencyException?
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 DBConcurrencyException
then). If you want to catch different types of exceptions and handle
them differently, you can write:

try

catch ex as DBConcurrencyException
'...
catch ex as WhateverException
'...
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
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 {...
40
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
11
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...
2
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...
8
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...
7
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...
0
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....
4
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
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....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.