I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB? 6 3379
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
Exceptions will bubble up automatically unless you have the debugger
attached. With the debugger attached and unhandled exceptions will
cause execution to stop and put the debugger in step-through mode. You
can set what the debugger does with different types of exceptions
using the Exceptions window (found under the Debug menu).
If you want to see what would happen when the application doesn't have
the debugger attached you can run the app by pressing Ctrl+F5.
Thanks,
Seth Rowe
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
Exceptions will bubble up automatically unless you have the debugger
attached. With the debugger attached and unhandled exceptions will
cause execution to stop and put the debugger in step-through mode. You
can set what the debugger does with different types of exceptions
using the Exceptions window (found under the Debug menu).
If you want to see what would happen when the application doesn't have
the debugger attached you can run the app by pressing Ctrl+F5.
Thanks,
Seth Rowe
I understand the debugger, My question is when debugger catches the
exception, instead of me manually going to the call stack and finding
the correct place the data became corrupt, can I simply tell the
debugger to "not handle exceptions" until they esculate above that
level. Does that make sense? Basically all the code at the bottom is
trust-worthy decent code, can I exclude the debugger from stepping
into it and can I exclude the code from being stopped inside those
functions?
Phillip,
In .Net, if an exception occurs in a method that is not equipped to handle
it, the exception is propagated back to the calling method. If the calling
method also has no exception handler, the exception is propagated back to
that method 's caller, and so on. If no exception handler is found, an error
message is displayed and the application is terminated.
Perhaps in the IDE you are breaking whenever an exception is thrown. You can
change this behavior from the IDE's Debug menu, under the Exception item.
Kerry Moorman
"Phillip Taylor" wrote:
>
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
On Aug 10, 9:54 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
Exceptions will bubble up automatically unless you have the debugger
attached. With the debugger attached and unhandled exceptions will
cause execution to stop and put the debugger in step-through mode. You
can set what the debugger does with different types of exceptions
using the Exceptions window (found under the Debug menu).
If you want to see what would happen when the application doesn't have
the debugger attached you can run the app by pressing Ctrl+F5.
Thanks,
Seth Rowe
I understand the debugger, My question is when debugger catches the
exception, instead of me manually going to the call stack and finding
the correct place the data became corrupt, can I simply tell the
debugger to "not handle exceptions" until they esculate above that
level. Does that make sense? Basically all the code at the bottom is
trust-worthy decent code, can I exclude the debugger from stepping
into it and can I exclude the code from being stopped inside those
functions?
Reread my post - I said you could use the Exceptions tool under the
Debug menu to set which types of exceptions the debugger will break
on.
Thanks,
Seth Rowe
On Aug 10, 3:20 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:54 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
Exceptions will bubble up automatically unless you have the debugger
attached. With the debugger attached and unhandled exceptions will
cause execution to stop and put the debugger in step-through mode. You
can set what the debugger does with different types of exceptions
using the Exceptions window (found under the Debug menu).
If you want to see what would happen when the application doesn't have
the debugger attached you can run the app by pressing Ctrl+F5.
Thanks,
Seth Rowe
I understand the debugger, My question is when debugger catches the
exception, instead of me manually going to the call stack and finding
the correct place the data became corrupt, can I simply tell the
debugger to "not handle exceptions" until they esculate above that
level. Does that make sense? Basically all the code at the bottom is
trust-worthy decent code, can I exclude the debugger from stepping
into it and can I exclude the code from being stopped inside those
functions?
Reread my post - I said you could use the Exceptions tool under the
Debug menu to set which types of exceptions the debugger will break
on.
Thanks,
Seth Rowe
I understand the concept of exceptions....if I don't catch it in the
"ExecuteSQLCommand" it propogates up the callstack until it finds a
Try Catch block around it. I understand I can catch and throw
exceptions anywhere. I understand if the debugger is off and there is
no exception handling code then the application will crash and
the .NET runtime will show an error message and end my application. I
understand exceptions completely. What I don' t understand is that if
this is my call stack looks like this:
button_click
- eventListener
-- custom code
--- ExecuteSQLCommand
how I can make the exception, which I don't want to catch or handle,
that could be any subclass of the exception object, will take the
debugger and instead of stopping it on the "ExecuteSQLCommand"
function, I can make it stop in the "custom code" function instead, on
the line at which it calls ExecuteSQLCommand.
In Java I can declaire "ExecuteSQLCommand" like this "public int
ExecuteSQLCommand(String sql) THROWS EXCEPTION" and the debugger moves
me to "custom code" level rather than the "ExecuteSQLStatement" level.
Can I do something similar in VB.NET? Don't take me to here with the
debugger....but take me to this level in the call stack instead?
On Aug 10, 12:06 pm, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
On Aug 10, 3:20 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:54 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.Tay...@gmail.com>
wrote:
I don't like the way every time I write a bad sql query the debugger
takes me to the database access code. It's extremely stable and
reliable and the exceptions being thrown are because of SQL queries
data passed to it. I don't want to handle or supress exceptions at
that point in the application, but rather ignore them so the debugger
handles them in the correct place, further up the call stack.
In java I could normally add a "throws Exception" to the end of the
function definitiion. Does anyone know how do I do the same thing in
VB?
Exceptions will bubble up automatically unless you have the debugger
attached. With the debugger attached and unhandled exceptions will
cause execution to stop and put the debugger in step-through mode. You
can set what the debugger does with different types of exceptions
using the Exceptions window (found under the Debug menu).
If you want to see what would happen when the application doesn't have
the debugger attached you can run the app by pressing Ctrl+F5.
Thanks,
Seth Rowe
I understand the debugger, My question is when debugger catches the
exception, instead of me manually going to the call stack and finding
the correct place the data became corrupt, can I simply tell the
debugger to "not handle exceptions" until they esculate above that
level. Does that make sense? Basically all the code at the bottom is
trust-worthy decent code, can I exclude the debugger from stepping
into it and can I exclude the code from being stopped inside those
functions?
Reread my post - I said you could use the Exceptions tool under the
Debug menu to set which types of exceptions the debugger will break
on.
Thanks,
Seth Rowe
I understand the concept of exceptions....if I don't catch it in the
"ExecuteSQLCommand" it propogates up the callstack until it finds a
Try Catch block around it. I understand I can catch and throw
exceptions anywhere. I understand if the debugger is off and there is
no exception handling code then the application will crash and
the .NET runtime will show an error message and end my application. I
understand exceptions completely. What I don' t understand is that if
this is my call stack looks like this:
button_click
- eventListener
-- custom code
--- ExecuteSQLCommand
how I can make the exception, which I don't want to catch or handle,
that could be any subclass of the exception object, will take the
debugger and instead of stopping it on the "ExecuteSQLCommand"
function, I can make it stop in the "custom code" function instead, on
the line at which it calls ExecuteSQLCommand.
In Java I can declaire "ExecuteSQLCommand" like this "public int
ExecuteSQLCommand(String sql) THROWS EXCEPTION" and the debugger moves
me to "custom code" level rather than the "ExecuteSQLStatement" level.
Can I do something similar in VB.NET? Don't take me to here with the
debugger....but take me to this level in the call stack instead?
How about :
Public Sub CustomCode()
ExecuteSqlCommand("Select * From WhereEver")
End Sub
Public Sub ExecuteSqlCommand(sql as String)
Try
'// Normal code here
Catch
Throw
End Try
End Sub
IIRC the debugger breaks where an exception is unhandled. The
try...catch...throw in the ExecuteSqlCommand sub should be marked as
handling the exception meaning the debugger will stop once the
exception bubbles back up to CustomCode.
I haven't tested this - so please let me know what happens either way.
Thanks,
Seth Rowe This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kerri |
last post by:
Hi,
I am new to .NET
In my Error Logic on my Aspx pages when an error happens
it hits my catch statement where I throw an Exception.
My question is :
what is the difference between Thwo...
|
by: Eric Lilja |
last post by:
Hello, in my program I have a function (pseudo code):
void start_mysql_service()
{
obtain handle
start mysql service using handle
if start fails close handle and throw an exception...
|
by: Pierre Rouleau |
last post by:
The std::exception class defined in the Standard C++ <exception> header
specifies that the constructors could throw any exception becuase they
do not have a throw() specification.
Why is that? ...
|
by: Lasse Vågsæther Karlsen |
last post by:
From the book by Jeffrey Richter:
throw; will not change the origin of the exception, whereas
throw ex; will change the origin of the exception to this statement.
When I try the following...
|
by: hplloyd |
last post by:
Hi,
I have a function that adds data to a database and I want to return true if
the database was updated and false if there was a problem, so I am using a
try... catch block...
My problem is...
| |
by: Henryk |
last post by:
I did a lot of delphi GUI programming recently.
In my experience most of the time you just want to throw a standard
exception with a descriptive message. Then all calling functions can
handle...
|
by: nospam_news |
last post by:
When language changes make old code uncompilable, that's not what is
called protection of investment.
New compilers (g++ 3.2.3) reject classes where methods throw the
class they belong to.
gcc...
|
by: Jess |
last post by:
Hello,
It is said that if I implement a "swap" member function, then it
should never throw any exception. However, if I implement "swap" non-
member function, then the restriction doesn't...
|
by: jason.cipriani |
last post by:
Consider this program, which defines a template class who's template
parameter is the type of an exception that can be thrown by members of
the class:
=== BEGIN EXAMPLE ===
#include...
|
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,...
|
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...
| |
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,...
|
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...
|
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: 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: 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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |