views:

74

answers:

1

What are the sql exceptions will thrown by using the following function:

  1. Read
  2. Update
  3. Write
A: 

The SqlException class exposes an Errors property which is an SqlErrorCollection containing instances of the SqlError class. Each SqlError instance represents a particular Error message that was returned from SQL server.

By the same token, the OleDbException class enables you to get at each OleDbError returned from the OleDb datasource.

So, in other words, you will not see different CLI exceptions being raised for each kind of SQL operation - you will only receive an SqlException. The onus is on you to examine the errors therein.

Cerebrus