
The SqlCeException Object
When an engine error occurs, a SqlCeException object is created. This exception object contains the SqlCeErrorCollection object. This in turn contains a collection of SqlCeError objects, one for each error in the exception. The SqlCeErrorCollection object can be accessed directly using the SqlCeException.Errors property. Each SqlCeError object contains an array of error parameters that provide detailed information about the error. Unlike SQL Server, SQL Server Compact 3.5 returns detailed information about an error as a collection of parameters. When you are building error messages, we recommend that you use a series of nested FOR loops to retrieve each parameter in each SqlCeError object in the collection.