.Net Interview Questions and Answers

Search:

.NET interview questions: - What are system level exceptions and application level exceptions?

By : Shiv Prasad Koirala | Nov 15th, 2013 | Views : 3904 | Comments : 0 Bookmark and Share

Exceptions that are thrown by .NET framework are called as system exceptions. These errors are non-recoverable or fatal errors like ArgumentOutOfRangeException, IndexOutOfRangeException, StackOverflowException etc.

 

Application exceptions are custom exceptions created for the application. Application exceptions are created by deriving from "ApplicationException" class as shown below. You can then create the object of the below exception and throw the same from the code and catch the same on the client side.

 

public class MyOwnException : ApplicationException

  private string messageDetails = String.Empty;

  public DateTime ErrorTimeStamp get; set;}

  public string CauseOfError get; set;}

 

  public MyOwnException()}

  public MyOwnException(string message,

    string cause, DateTime time)

 

    messageDetails = message;

    CauseOfError = cause;

    ErrorTimeStamp = time;

  }

 

  // Override the Exception.Message property.

  public override string Message

 

    get

   

      return string.Format("This is my own error message");

    }

  }

}

 

Also see following basic but important .NET interview questions video on debug directive

 

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi