Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SqlErrorCollection Class

 

Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.

Namespace:   System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

System::Object
  System.Data.SqlClient::SqlErrorCollection

[SerializableAttribute]
[ListBindableAttribute(false)]
public ref class SqlErrorCollection sealed : ICollection, IEnumerable

NameDescription
System_CAPS_pubpropertyCount

Gets the number of errors in the collection.

System_CAPS_pubpropertyItem[Int32]

Gets the error at the specified index.

NameDescription
System_CAPS_pubmethodCopyTo(Array^, Int32)

Copies the elements of the SqlErrorCollection collection into an Array, starting at the specified index.

System_CAPS_pubmethodCopyTo(array<SqlError^>^, Int32)

Copies the elements of the SqlErrorCollection collection into a SqlErrorCollection, starting at the specified index.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the SqlErrorCollection.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection::IsSynchronized

For a description of this member, see IsSynchronized.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection::SyncRoot

For a description of this member, see SyncRoot.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

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

The following example displays each SqlError within the SqlErrorCollection collection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2017 Microsoft