Skip to Content
Essential ADO.NET
book

Essential ADO.NET

by Bob Beauchemin
May 2002
Beginner to intermediate content levelBeginner to intermediate
560 pages
11h 36m
English
Addison-Wesley Professional
Content preview from Essential ADO.NET

3.10. Error Handling

If you need to handle only a single error, you can use the generic Exception class, which reports a single error message. Sometimes, databases return additional error information or a collection of errors. This is especially true of OLE DB, in which each provider can add information when using the service provider architecture. For this reason, SqlClient and OleDb each implements its own subclass of Exception, which can return a collection of errors.

The OleDb provider's OleDbException exposes an OleDbErrorCollection that is similar to the ADO's Errors collection (OLE DB's IErrorRecord). Each error contains an error message, the provider's native error, and an optional SQLState. The OleDbException is derived from InteropServices.ExternalException ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® ADO.NET 4 Step by Step

Microsoft® ADO.NET 4 Step by Step

Tim Patrick
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 0201758660Purchase book