Back to Browse

Exception Handling in C# | Exception Handling in CSharp with Examples

708 views
Sep 13, 2022
51:36

Exception Handling in C# | Exception Handling in CSharp with Examples In this video, I am going to discuss Exception Handling in C# with Examples. This is one of the most important concepts in C#. As a developer, while developing any application, it is our key responsibility to handle the exception. Exception Handling is a procedure to handle the exception which occurred during the execution of a program. As part of this video, we are going to discuss the following pointers in detail. 1. What are the Different Types of Errors? 2. What is an Exception in C#? 3. Who is responsible for abnormal termination of the program whenever runtime errors occur in the program? 4. What happens if an Exception is Raised in the program? 5. What CLR does when an Exception Occurred in the Program? 6. What is Exception Handling in C#? 7. Why do we need Exception Handling in C#? 8. What is the Procedure to Handle Exceptions in C#? 9. What is the Logical Implementation in C# to Handle Exception? 10. Exception handling in C# using Try Catch implementation 11. Properties of Exception Class in C# Types of Errors in C# When we write and execute our code in the .NET framework then there is a possibility of two types of error occurrences. They are as follows: 1. Compilation Errors 2. Runtime Errors Compilation Error in C# The error that occurs in a program at the time of compilation is known as a compilation error (compile-time error). These errors occur due to syntactical mistakes in the program. That means these errors occur by typing the wrong syntax like missing double quotes in a string value and missing terminators in a statement, typing wrong spelling for keywords, assigning wrong data to a variable, trying to create an object for abstract class and interface, etc. So, whenever we compile the program, the compiler recognizes these errors and it will show us the list of errors. So, in simple words, we can say that this type of error occurs due to a poor understanding of the programming language. These errors are identified by the compiler and can be rectified before the execution of the program only. So, these errors do not cause any harm to the program execution. Runtime Error in C# The errors which are occurred at the time of program execution are called runtime errors. These errors occurred at runtime due to various reasons such as when we are entering the wrong data into a variable, trying to open a file for which there is no permission, trying to connect to the database with the wrong user id and password, the wrong implementation of logic, and missing required resources, etc. So, in simple words, we can say that the errors which are come while running the program are called runtime errors. Runtime errors are dangerous because whenever they occur in the program, the program terminates abnormally on the same line where the error gets occurred without executing the next line of code. Note: The compiler will never check the logic, the compiler will only check the syntaxes. So, the compiler will identify the syntax error, but not the logical error. What is an Exception in C#? An Exception is a class in C# which is responsible for abnormal termination of the program when runtime errors occur while running the program. So, these errors (runtime) are very dangerous because whenever the runtime errors occur in the programs, the program gets terminated abnormally on the same line where the error gets occurred without executing the next line of code. The text document of this video: https://dotnettutorials.net/lesson/exception-handling-csharp/ #exceptionhandlingcsharp #csharpexceptionhandlingexamples #exceptionhandling #csharp #dotnettutorials Exception Handling Exception Handling in C# Exception Handling in C# with Examples Exception Handling in CSharp Exception Handling in CSharp with Examples C# Exception Handling C# Exception Handling Examples C# Exception Handling with Examples CSharp Exception Handling CSharp Exception Handling with Examples Why Exception Handling in C#? Why Exception Handling in CSharp? What is Exception Handling in C#? What is Exception Handling in CSharp?

Download

0 formats

No download links available.

Exception Handling in C# | Exception Handling in CSharp with Examples | NatokHD