Class MySqlException
The exception that is thrown when MySQL returns an error. This class cannot be inherited.
Inheritance
System.Object
System.Exception
System.SystemException
System.Runtime.InteropServices.ExternalException
System.Data.Common.DbException
MySqlException
Implements
System.Runtime.Serialization.ISerializable
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
[Serializable]
public sealed class MySqlException : DbException, ISerializable
Remarks
This class is created whenever the MySQL Data Provider encounters an error generated from the server.
Any open connections are not automatically closed when an exception is thrown. If the client application determines that the exception is fatal, it should close any open MySqlDataReader objects or MySqlConnection objects.
Properties
Code
Gets an integer that representes the MySQL error code.
Declaration
public uint Code { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Number
Gets a number that identifies the type of error.
Declaration
public int Number { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SqlState
Gets the SQL state.
Declaration
public string SqlState { get; }
Property Value
Type | Description |
---|---|
System.String |
Implements
System.Runtime.Serialization.ISerializable