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 3386
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.T ay...@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...@yah oo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.T ay...@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.T ay...@gmail.com >
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.T ay...@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...@yah oo.comwrote:
On Aug 10, 9:54 am, Phillip Taylor <Phillip.Ross.T ay...@gmail.com >
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.T ay...@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....i f I don't catch it in the
"ExecuteSQLComm and" 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
--- ExecuteSQLComma nd
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 "ExecuteSQLComm and"
function, I can make it stop in the "custom code" function instead, on
the line at which it calls ExecuteSQLComma nd.
In Java I can declaire "ExecuteSQLComm and" like this "public int
ExecuteSQLComma nd(String sql) THROWS EXCEPTION" and the debugger moves
me to "custom code" level rather than the "ExecuteSQLStat ement" 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.T ay...@gmail.com >
wrote:
On Aug 10, 3:20 pm, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 10, 9:54 am, Phillip Taylor <Phillip.Ross.T ay...@gmail.com >
wrote:
On Aug 10, 2:48 pm, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Aug 10, 9:36 am, Phillip Taylor <Phillip.Ross.T ay...@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....i f I don't catch it in the
"ExecuteSQLComm and" 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
--- ExecuteSQLComma nd
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 "ExecuteSQLComm and"
function, I can make it stop in the "custom code" function instead, on
the line at which it calls ExecuteSQLComma nd.
In Java I can declaire "ExecuteSQLComm and" like this "public int
ExecuteSQLComma nd(String sql) THROWS EXCEPTION" and the debugger moves
me to "custom code" level rather than the "ExecuteSQLStat ement" 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()
ExecuteSqlComma nd("Select * From WhereEver")
End Sub
Public Sub ExecuteSqlComma nd(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...t hrow in the ExecuteSqlComma nd 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 Exception and Throw
|
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 containing error
description
|
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? Is this because there could be an exception thrown when
the code creates a std::exception? I would assume that is not the case.
However, if I want...
|
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 program, I get this result:
3: at ... in c:\dev\vs.net\exceptiontest3\form1.cs:line 91
2: at ... in c:\dev\vs.net\exceptiontest3\form1.cs:line 101
1:...
|
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 that I can return true ok is the routine succeeds but where do
I put the return false; statement id the process fails - I get a compile
error say...
| |
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 this exception as they like and finally show a message to the
user or not. Only in a few occasions I need some special exception
types to behave...
|
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 2.95.3 allowed it.
What are the minimal modification, that leave the usage of the class
sound and can be compiled by newer compilers.
|
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 apply. Can somebody tell
me why?
Thanks,
Jess
|
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 <iostream>
#include <string>
using namespace std;
|
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...
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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...
|
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...
|
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...
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |