Hi,
Requirement is:
try
{
\\SQL Query
}
catch(Exception i)
{
print a
}
catch(SQLQueryException e)
{
\\SQL Query
}
Got Exception in "try" block. Which "catch" throws
exception and Why???
Please provide the answer in detail..
Thanks for the help!!!
Answers were Sorted based on User's Feedback
Answer / djana
I tried I got the following ...
Error 1 A previous catch clause already catches all exceptions of this or of a super type ('System.Exception') E:\dotnet\ConsoleApplication1\ConsoleApplication1\Program.cs 58 20 ConsoleApplication1
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / syed
The generic exception (Catch(Exception e)) should be
written after all the specific exceptions are written.
if any specific exception is written after the general
exception that will be of no use, as for all the exceptions
that were encountered in the try block will be catched by
the generic exception.
hope u got it.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kaushik
catch(SQLQueryException e)
{
\\SQL Query
}
would throw exception as a try can have more than one catch
block that the related exception can be handled individually
| Is This Answer Correct ? | 0 Yes | 2 No |
What is different between webusercontrol and in webcustomcontrol?
How com+ related to the dna architecture?
Write code for fetch record nos 15 to 25 from a dataset containing 50 records?
differance between checkbox and rediobutton in vb.net?
What is Atomicity?
Write Code for DataSet,Datareader,and by deleting the button gridview should be empty?
Is it true that objects don't always get destroyed immediately when the last reference goes away?
which is the best dot net coaching center in visakhapatnam??
C++ & C# differences ?
What is the intermediate language between asp and asp.net1.0?
What is data type and how many types of data types are in .NET ?
What does SCM do?