asp.net.ph

SqlErrorCollection Class

System.Data.SqlClient Namespace


Collects all errors thrown by the SqlDataAdapter.

SqlErrorCollection Class Members

Collapse   Properties

Visibility Name Value Type Accessibility
public Count Int32 [ Get ]
public Item ( Int32 index ) SqlError [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public CopyTo ( SqlError array , Int32 index ) Void
public CopyTo ( Array array , Int32 index ) Void
public GetEnumerator ( ) IEnumerator

Remarks

This class is created by SqlException to collect instances of the SqlError class. SqlErrorCollection always contains at least one instance of the SqlError class.

Example

The following example displays each SqlError within the SqlErrorCollection.

public void DisplaySqlErrors ( SqlException myException ) {

   for ( int i=0; i < myException.Errors.Count; i++ ) {
      Response.Write ( "Index #" + i + "<br>" +
         "Error: " + myException.Errors [ ].ToString ( ) + "<br>" );
   }
}
  C# VB

See Also

SqlError   SqlException Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph