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

Does the Visual Studio's Help Index list all Exceptions?

I learned about Exceptions in School, and now that I'm building my
first real application on the job, I'm going through it trying to
analyze it for all possible Exceptions so I can handle them
effectively. I've been looking in the Help / Index for each Method's
documentation, and looking at the listed Exceptions. I'm finding a
number of methods with no Exceptions specified. Does that mean there
is no possible Exception for that method? Can I count on the
documentation in that way?

Like OleDbCommand.ExecuteReader. I'm using an Access database and
when I do a query that returns the resultset. No Exception is
listed. That method never throws an Exception???

Nov 20 '05 #1
2 3490
Hi Felecha

The documentation lists all exceptions thrown by the runtime.

For an exhaustive list look up exception, you will see this is subclassed by
SystemException, which is what the runtime uses as a base class for all its
exceptions and ApplicationException which the class you should inherit from
if you wish to create custom exceptions in your own applications.

With respect to OleDbCommand.ExecuteReader this does throw an exception
InvalidOperationException.
However more generally you will seek to catch the OleDbException thrown from
the datasource (Access2000).

In this case it is not the method but the Jet engine that is throwing the
exception hence the reason why you do not see it listed under
..ExecuteReader.

OleDbException inherits from InterOpServices.ExternalException which
inherits from SystemException.
If you need access to the HResult thrown by the Jet engine, check out the
ErrorCode property of the OleDbException.

You should also note that when you move up to SqlServer, OleDbException is
replaced by SqlException, which is governed by the same philosophy as
OleDbException, except that it is SqlServer specific.

Additionally just because a method doesn;t list an exception as being thrown
does not mean that by using that method no exceptional conditions can occur
that cause it's code to break. It just means the framework does not
explicity throw an exception when that given exception occurs.

This is a subtle but important difference.

Just as when you write code, you may expect a certain condition to be true
and if it is not, you may decide to throw an exception. However if an
exceptional condition occurs that you didn;t think about before releasing
your code library/app, then your code will still automatically throw an
exception, it's just that you personally have not explicitly thrown that
error and therefore it will not be documented in your help files. The same
is true for Microsofts code and docs for .Net.

If you do something really stupid with a method it will throw an exception
and if this hasn't been accounted for by the framework developers, then it
wont be documented.

hth
Richard

"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I learned about Exceptions in School, and now that I'm building my
first real application on the job, I'm going through it trying to
analyze it for all possible Exceptions so I can handle them
effectively. I've been looking in the Help / Index for each Method's
documentation, and looking at the listed Exceptions. I'm finding a
number of methods with no Exceptions specified. Does that mean there
is no possible Exception for that method? Can I count on the
documentation in that way?

Like OleDbCommand.ExecuteReader. I'm using an Access database and
when I do a query that returns the resultset. No Exception is
listed. That method never throws an Exception???

Nov 20 '05 #2
Thanks. I've read your reply carefully and am trying to digest it.
Every point is applicable and I need to think about it, I can see.

Thanks a lot

Nov 20 '05 #3

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

Similar topics

10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
2
by: RalphTheExpert | last post by:
This thread is a continuation of a thread with the Subject "Unhandled exception - Different under debugger and non-debugger". (http://www.dotnetnewsgroups.com/newsgroupthread.asp?ID=186902) ...
6
by: Mike | last post by:
I would like to know if it is possible to stop VS from automatically assigning a z-index to a drop down list when I add it to my web page in design mode. Or if that is not possible, how can I tell...
4
by: Martin Odhelius | last post by:
Hello, I have a very fustrating problems while debugging ASP.NET applications. When I am debugging and stepping thru code (with F10 or F11) Visual Studio some times suddenly just stop responding...
1
by: ME | last post by:
I was running into a problem with the DataGridView while binding it to an object Collection. I got it working and I thought others might like to know how. -------------- Problem -------------...
4
by: cantatahost | last post by:
Hello, Likely this has been asked before... We have a library (in DLL form) that we distribute. The interface to the library is all C, but within the library it uses C++ in many places. ...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
96
by: zzbbaadd | last post by:
What's with the index() function of lists throwing an exception on not found? Let's hope this is rectified in Python 3. If nothing else, add a function that doesn't throw an exception. There are a...
34
by: raylopez99 | last post by:
What is the state of C#? Somebody in a Linux advocacy newsgroup implied it has saturated (leveled off in growth). Note the 'hard code' pre-Wizards coding wizard Charles Petzold does C# only now....
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
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...
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
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
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
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,...
0
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...

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.