sosanjay
9th October 2009, 08:05
hello,
i'm able to connect with db[MySql].
i'm trying to Execute the Sql Query but i'm not getting wrong result.
I want to get the number of row in the current table.
My Query is :
QSqlQuery q1("SELECT COUNT(RecordId) FROM tbl;");
QSqlRecord rec1 = q1.record();
QString Str = q1.value(0).toString();
QMessageBox::information(this, tr("Count"),Str);
The result in message box is NULL.
if we run the sql query normally we get the result i.e 10;
What wrong in the query.
i'm able to connect with db[MySql].
i'm trying to Execute the Sql Query but i'm not getting wrong result.
I want to get the number of row in the current table.
My Query is :
QSqlQuery q1("SELECT COUNT(RecordId) FROM tbl;");
QSqlRecord rec1 = q1.record();
QString Str = q1.value(0).toString();
QMessageBox::information(this, tr("Count"),Str);
The result in message box is NULL.
if we run the sql query normally we get the result i.e 10;
What wrong in the query.