
'Declaration
Public NotInheritable Class MimerException Inherits System.Data.Common.DbException
public sealed class MimerException : System.Data.Common.DbException
public class MimerException = class(System.Data.Common.DbException)sealed;
public sealed class MimerException extends System.Data.Common.DbException
public __gc __sealed class MimerException : public System.Data.Common.DbException
No example is available for C++ or JScript. To view a C# example, click the Language Filter button in the upper-left corner of the page.
MimerCommand command = new MimerCommand(); command.CommandText = "INSERT INTO TAB1 VALUES(1, DATE '2008-12-01')"; command.Connection = connection; try { command.ExecuteNonQuery() } catch (MimerException ex) { if (ex.Errors.Count > 0 && ex.Errors[0].ConstraintName == "PK1") { Console.WriteLine("Duplicate primary key"); } else { Console.WriteLine("Error message: " + ex.Message); } }
Dim command As New MimerCommand command.CommandText = "INSERT INTO TAB1 VALUES(1, DATE '2008-12-01')" command.Connection = connection Try command.ExecuteNonQuery() Catch ex As MimerException If ex.Errors.Count > 0 And ex.Errors(0).ConstraintName == "PK1" Then Console.WriteLine("Duplicate primary key") Else Console.WriteLine("Error message: " + ex.Message) End If End Try
System.Object
System.Exception
System.SystemException
System.Runtime.InteropServices.ExternalException
System.Data.Common.DbException
Mimer.Data.Client.MimerException
.NET Framework
Version 2.0 or later