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 |
Is .net is platform independent. If am using solaris, installing .net first u had to install framework, so framework is .exe file then it will not take in solaris or any other than windows,then how .net is platform independent.
How to produce an assembly?
. How .NET can support multiple languages?
What is the difference between custom control and web control?
Explain can 2 different applications use the same dll in gac at the same time?
what is use of learning .net? does we get good jobs based on .net?
Please send me the latest asp.net,c#,sql server interview questions .my email id is ramtryin@gmail.com
What security measures exist for .NET Remoting in System.Runtime.Remoting?
Dot Net is Platform Independent or Platform Dependent..?
What is the difference between a debug and release build?
How many types of generations are there in a garbage collector?
As you know read-only variables and constants have many similarities, but what is at least one way that they differ?