dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlException Class / Code Property
Example

In This Topic
    Code Property (MySqlException)
    In This Topic
    Gets a code that identifies the type of error.
    Syntax
    'Declaration
     
    Public ReadOnly Property Code As Integer
    public int Code {get;}

    Property Value

    A code that identifies the type of error.
    Remarks
    This error can be explained using MySQL server SHOW WARNINGS command.
    Example
    The following example displays the System.Exception.Message and Code properties of the exception.
    public void DisplayMySqlErrorCollection(MySqlException myException) {
      MessageBox.Show("Message: " + myException.Message + "\n" +
        "Code: " + myException.Code.ToString());
    }
    Public Sub DisplayMySqlErrorCollection(myException As MySqlException)
      MessageBox.Show("Message: " + myException.Message + ControlChars.Cr _
        + "Code: " + myException.Code.ToString())
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also