Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtSql.QSqlError Class Reference

The QSqlError class provides SQL database error information. More...

Inheritance diagram for QtSql.QSqlError:
Collaboration diagram for QtSql.QSqlError:

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]
 

Detailed Description

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().

Member Enumeration Documentation

This enum type describes the context in which the error occurred, e.g., a connection error, a statement error, etc.

Enumerator:
ConnectionError 

Connection error.

NoError 

No error occurred.

StatementError 

SQL statement syntax error.

TransactionError 

Transaction failed error.

UnknownError 

Unknown error.

Constructor & Destructor Documentation

QtSql.QSqlError.QSqlError ( System.Type  dummy)
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.

Member Function Documentation

virtual void QtSql.QSqlError.CreateProxy ( )
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().

Member Data Documentation

SmokeInvocation QtSql.QSqlError.interceptor
protected

Property Documentation

new string QtSql.QSqlError.DatabaseText
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.

new string QtSql.QSqlError.DriverText
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.

new int QtSql.QSqlError.Number
getset

Returns the database-specific error number, or -1 if it cannot be determined.

Sets the database-specific error number to number.

virtual System.IntPtr QtSql.QSqlError.SmokeObject
getset
new QSqlError.ErrorType QtSql.QSqlError.Type
getset

Returns the error type, or -1 if the type cannot be determined.

Sets the error type to the value of type.