GeekInterview.com
Series: Subject: Topic:
Question: 97 of 460

How to handle exceptions without using try catch finally

Asked by: Interview Candidate | Asked on: Sep 27th, 2006
Showing Answers 1 - 15 of 15 Answers
ajeez

Answered On : Oct 10th, 2006

No,there is no way without try catch finally

Yes  1 User has rated as useful.
  
Login to rate this answer.
ganesh

Answered On : Oct 23rd, 2006

its highly imposible to handle exceptions without using try and catch.

  
Login to rate this answer.
eran

Answered On : Oct 31st, 2006

Callbacks: Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

  
Login to rate this answer.
Sudheer

Answered On : Nov 27th, 2006

Another way of doing this is using Application Blocks.

U can write the code without try/catch block and yet catch them using application blocks.

Regards,

Sudheer.K

9989237627

  
Login to rate this answer.
Nila

Answered On : Jan 15th, 2007

You will have to anticipate any possible complications, then deal with them accordingly (e.g. division by zero). This is much better if done intelligently because it uses alot less resources than exception handling would.

  
Login to rate this answer.
Ashish

Answered On : Jan 30th, 2007

We Can handle exception without using Try/Catch Block in Global. asax file.It can be handled in Application_error event.

  
Login to rate this answer.
Bishwajeet

Answered On : Oct 20th, 2011

Yes it is possible to handle exception without using try catch. We can implement If...Else block with GoTo Statement. It will be complex but possible.

  
Login to rate this answer.
testernew

Answered On : Oct 23rd, 2011

View all answers by testernew

use "using" keyword. Make sure that the object instance you are creating must be inherited by IDisposable interface.

Example:

public class Test:IDisposable
{
/// class methods
/// Idisposable interface method implementation
}

using(Test obj = new Test()){
// your logic here
}

  
Login to rate this answer.
HansSr

Answered On : Oct 26th, 2011

View all answers by HansSr

build a custom exception and test if the exception has been triggered.

  
Login to rate this answer.

Yes it possible to handle. Just code for the exception.

  
Login to rate this answer.
Dadan Tiwari

Answered On : Feb 13th, 2012

Define custom error mode in web.config file and redirect user to error pages

  
Login to rate this answer.
Sivavt

Answered On : Mar 25th, 2012

View all answers by Sivavt

Possible at application level - Global.asax - Application_Error()

  
Login to rate this answer.
sudeep

Answered On : Nov 11th, 2012

Yes, Without using try and cache block exception handling is possible.
By using if and else statement we can handle exception. It is the more efficient way to handle the exception.

try it!!

Yes  1 User has rated as useful.
  
Login to rate this answer.
iaskalyani45

Answered On : Jan 18th, 2013

View all answers by iaskalyani45

By using "if else" conditional statement

  
Login to rate this answer.
vpote

Answered On : Apr 15th, 2013

View all answers by vpote

The best way to do this would be doing the same in global.asax application_error method.

Thanks
Vijay

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.