ASP.Net Error and Exception Handling for ADO.Net

by top54u.com 13 May, 2008
Spotlight.....

Introduction

While working with ADO.Net components it’s important to manage the code by proper Error and Exception Handling techniques. It’s the fact that when any system becomes more and more complex then the possibility of errors or exceptions also increases along with its scale. Even if you are capable of writing a flawless code, there is no guarantee that it will execute normally at runtime. Coz while executing there are number of possibilities that can throw exceptions to stop the code execution. These possible issues may be slow connections causing connection timeouts, network connection failures or any type of failure in Operating System or Power. A few good habits of coding can provide the solution to prevent the wrong debugging error screens to the users visiting your web site.

 

Error Handling

ADO.Net error handling support is provided by the .Net Framework. Errors and Exceptions can be detected and handled through the standard coding techniques for error handling in ASP.Net. When you code for ADO.Net data access components .Net Framework provide support for handling the errors and exception for SQL Server .Net Data Provider, OleDb .Net Data Provider, ODBC .Net Data Provider and also Oracle .Net Data Provider.

 

ADO.Net Exceptions

Following is the .Net Data Provider Exception Hierarchy for different type of Data Providers:

The .Net data providers convert the database specific errors into standard exception types. For getting the database errors specific exception types you have to use the relevant exception handling objects of ASP.Net.

All Exception types are derived from the base Exception class of System namespace. Different Data Access and Providers for .Net throws specific type of Exception e.g. SQL Server .Net Data Provider throws SqlException, OleDb throws OleDbException.

Catching and Handling ASP.Net Errors and exception in ADO.Net…

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

7/24/2008 5:23:17 PM

OUR SPONSORS[+ advertise here]
top54u ezines.....
related videos.....
recent posts.....