Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QSqlError class provides SQL database error information. More...
Public Types | |
enum | ErrorType { ConnectionError = 1, NoError = 0, StatementError = 2, TransactionError = 3, UnknownError = 4 } |
More... | |
Public Member Functions | |
QSqlError (QSqlError other) | |
| |
QSqlError (string driverText="", string databaseText="", QSqlError.ErrorType type=QSqlError.ErrorType.NoError, int number=-1) | |
| |
virtual void | CreateProxy () |
new bool | IsValid () |
| |
new string | Text () |
| |
new void | Dispose () |
Protected Member Functions | |
QSqlError (System.Type dummy) | |
Protected Attributes | |
SmokeInvocation | interceptor |
Properties | |
new string | DatabaseText [get, set] |
| |
new string | DriverText [get, set] |
| |
new int | Number [get, set] |
| |
new QSqlError.ErrorType | Type [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
The QSqlError class provides SQL database error information.
A QSqlError object can provide database-specific error data, including the driverText() and databaseText() messages (or both concatenated together as text()), and the error number() and type(). The functions all have setters so that you can create and return QSqlError objects from your own classes, for example from your own SQL drivers.
See also QSqlDatabase::lastError() and QSqlQuery::lastError().
This enum type describes the context in which the error occurred, e.g., a connection error, a statement error, etc.
|
protected |
QtSql.QSqlError.QSqlError | ( | QSqlError | other | ) |
Creates a copy of other.
QtSql.QSqlError.QSqlError | ( | string | driverText = "" , |
string | databaseText = "" , |
||
QSqlError.ErrorType | type = QSqlError.ErrorType.NoError , |
||
int | number = -1 |
||
) |
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number.
|
virtual |
new void QtSql.QSqlError.Dispose | ( | ) |
new bool QtSql.QSqlError.IsValid | ( | ) |
Returns true if an error is set, otherwise false.
Example:
QSqlQueryModel model;
model.setQuery("select * from myTable");
if (model.lastError().isValid())
qDebug() << model.lastError();
See also type().
new string QtSql.QSqlError.Text | ( | ) |
This is a convenience function that returns databaseText() and driverText() concatenated into a single string.
See also driverText() and databaseText().
|
protected |
|
getset |
Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.
Sets the database error text to the value of databaseText.
|
getset |
Returns the text of the error as reported by the driver. This may contain database-specific descriptions. It may also be empty.
Sets the driver error text to the value of driverText.
|
getset |
Returns the database-specific error number, or -1 if it cannot be determined.
Sets the database-specific error number to number.
|
getset |
|
getset |
Returns the error type, or -1 if the type cannot be determined.
Sets the error type to the value of type.