SqlCeError Class
Collapse the table of content
Expand the table of content

SqlCeError Class

Collects information relevant to a warning or error returned by the data source. This class cannot be inherited.

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

public sealed class SqlCeError
public final class SqlCeError
public final class SqlCeError

An instance of SqlCeError is created by the System.Data.SqlServerCe managed provider when an error occurs. The SqlCeErrorCollection contains one or more instances of SqlCeError.


The following example shows a typical use of SqlCeError.

    SqlCeReplication repl = new SqlCeReplication();
    // Fill repl properites here
    // ...
    // SqlCeReplication may throw SqlCeException which contains a 
    // collection of errors; SQL Mobile database engine always
    // returns one error in the collection
catch (SqlCeException e)
    foreach (SqlCeError error in e.Errors)
        // Use SqlCeError properties if you need specific
        // application logic depending on the error condition
        if (28577 == error.NativeError /*SSCE_M_SCHEMAHASCHANGED*/)
            // Error specific logic goes here...

        // Note: For native error numbers, refer to SQL Server Mobile Errors
        // in the SQL Server Mobile Books Online

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

Development Platforms

Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0

© 2015 Microsoft