Export (0) Print
Expand All

SqlCeErrorCollection Class

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

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

public sealed class SqlCeErrorCollection : ICollection, IEnumerable
public final class SqlCeErrorCollection implements ICollection, IEnumerable
public final class SqlCeErrorCollection implements ICollection, IEnumerable
Not applicable.

This class is created by SqlCeException to collect instances of the SqlCeError class. SqlCeErrorCollection always contains at least one instance of the SqlCeError class.

The following example displays each SqlCeError within the SqlCeErrorCollection collection.

public void DisplaySqlCeErrors(SqlCeErrorCollection errorCollection ) {
    StringBuilder bld = new StringBuilder();

    foreach (SqlCeError err in errorCollection) {
        bld.Append("\n Error Code: " + err.HResult.ToString("X"));
        bld.Append("\n Message   : " + err.Message);
        bld.Append("\n Minor Err.: " + err.NativeError);
        bld.Append("\n Source    : " + err.Source);
            
        foreach (int numPar in err.NumericErrorParameters) {
            if (0 != numPar) bld.Append("\n Num. Par. : " + numPar);
        }
            
        foreach (string errPar in err.ErrorParameters) {
            if (String.Empty != errPar) bld.Append("\n Err. Par. : " + errPar);
        }

        MessageBox.Show(bld.ToString());
        bld.Remove(0, bld.Length);
    }
}

System.Object
  System.Data.SqlServerCe.SqlCeErrorCollection

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

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft