Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator 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)
  More...
 
 QSqlError (string driverText="", string databaseText="", QSqlError.ErrorType type=QSqlError.ErrorType.NoError, int number=-1)
  More...
 
virtual void CreateProxy ()
 
new void Dispose ()
 

Protected Member Functions

 QSqlError (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

string DatabaseText [get, set]
  More...
 
string DriverText [get, set]
  More...
 
int Number [get, set]
  More...
 
QSqlError.ErrorType Type [get, set]
  More...
 
bool IsValid [get]
  More...
 
string Text [get]
  More...
 
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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Member Function Documentation

virtual void QtSql.QSqlError.CreateProxy ( )
virtual

Here is the caller graph for this function:

new void QtSql.QSqlError.Dispose ( )

Member Data Documentation

SmokeInvocation QtSql.QSqlError.interceptor
protected

Property Documentation

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.

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.

bool QtSql.QSqlError.IsValid
get

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

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
string QtSql.QSqlError.Text
get

This is a convenience function that returns databaseText() and driverText() concatenated into a single string.

See also driverText() and databaseText().

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.