473,403 Members | 2,222 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,403 software developers and data experts.

types of sql exception

Hi,

I have a windows form with a typed dataset. When i call an update on the
database i want to catch the exceptions. I was wondering what different
types of sql exceptions there are.

Also i was told that the order that you catch them is important. If so, what
sort of order is this?

Thank you for your time.

Claire

Nov 16 '05 #1
2 6608
Hi Claire,
"claire" <cl**********@hotmail.com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a windows form with a typed dataset. When i call an update on the
database i want to catch the exceptions. I was wondering what different
types of sql exceptions there are.
SqlException?

I'm reading now that it is not generated on .NET 1.0 though.
Also i was told that the order that you catch them is important. If so, what sort of order is this?
From the more especific to the more general, for example you put a catch
clause for SqlException and later one for Exception, it the exception is not
of type of SqlException or one of his derived classes it will jump to the
next catch clause , if the last clause is for Exception it will match all
the exceptions.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Thank you for your time.

Claire

Nov 16 '05 #2
You can catch exceptions through SqlException class, which may have multiple
exceptions. To do this 'correctly' you'll need to loop through the
exceptions. For exceptions w/ severity < 10, you can trap the InfoMessage
event (which will also give you back the results of Print Statements for
instance). This should help
http://www.knowdotnet.com/articles/connections.html

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"claire" <cl**********@hotmail.com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a windows form with a typed dataset. When i call an update on the
database i want to catch the exceptions. I was wondering what different
types of sql exceptions there are.

Also i was told that the order that you catch them is important. If so, what sort of order is this?

Thank you for your time.

Claire

Nov 16 '05 #3

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

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
7
by: Blake T. Garretson | last post by:
I'm having some issues with decimal.Decimal objects playing nice with custom data types. I have my own matrix and rational classes which implement __add__ and __radd__. They know what to do with...
5
by: p988 | last post by:
Could someone show me how to derive and use custom exception types separately from:System.Exception, System.Object and System.ApplicationException in C#? When people say:"Use Visual Studio .NET...
3
by: Cliff Harris | last post by:
I have an odd question that I'm hoping someone can help with. I simply (or not simply?) need to enumerate through all of the data types in the .Net framework. I do understand that if this is...
2
by: Danny Gagne | last post by:
I'm currently working an .net application (I can use 1.1 or 2.0 if needed) that needs to read a wsdl file and generate another piece of code that can use it. I'm encountering a problem where I...
5
by: Mitchell S. Honnert | last post by:
I'm thinking about adding unsigned types, like UShort and UInt, to a VB.NET library that I published which edits ID3 tag information. It would make the interface much more clean to have some...
6
by: Steven Livingstone | last post by:
Bit of advice here folks. I am creating a default constructor that just initializes a new instance of my object and a secon constructor that takes an ID and loads an object with data from the...
6
by: GarrettD78 | last post by:
Accidently posted this to the wrong group so I am reposting. This is probably a newbie question but I am a little confused about how to go next with my code. I think I want to use a factory pattern...
0
by: shaily | last post by:
hi I have a java web service called "Registration service" and C# client which is a consumer of that service java web service running under Tomcat has following interface API exposed ...
55
by: tonytech08 | last post by:
How valuable is it that class objects behave like built-in types? I appears that the whole "constructor doesn't return a value because they are called by the compiler" thing is to enable...
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: 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
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
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
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
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...

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.