hohoanganh205
5th January 2012, 11:44
I exec a statement SQL in MYSQL Workbench and result is: 2 ; pic:
7240
But in C++ QT I do not know how to get the value like MYSQL, I try this code and result not is: 2
void QuanLyDaiLy::on_pushButton_clicked()
{
QSqlQuery *qry = new QSqlQuery();
qry->prepare("select count(MaDaiLy) as SoDaiLyTrongQuan from DaiLy, Quan where DaiLy.Quan_TenQuan = Quan.TenQuan and Quan.TenQuan = 'Quan 10'");
qry->exec();
QMessageBox::information(this,"result",QString::number(qry->size()));
}
7241
what can I use to QString::number(qry->????????) to get the value ?
Thanks for help .
7240
But in C++ QT I do not know how to get the value like MYSQL, I try this code and result not is: 2
void QuanLyDaiLy::on_pushButton_clicked()
{
QSqlQuery *qry = new QSqlQuery();
qry->prepare("select count(MaDaiLy) as SoDaiLyTrongQuan from DaiLy, Quan where DaiLy.Quan_TenQuan = Quan.TenQuan and Quan.TenQuan = 'Quan 10'");
qry->exec();
QMessageBox::information(this,"result",QString::number(qry->size()));
}
7241
what can I use to QString::number(qry->????????) to get the value ?
Thanks for help .