C++ (Qt)queryCount.exec("SELECT COUNT(hd_pcid) FROM hardware_data WHERE hd_pcid = '"+pc_id+"'"); recordCount = queryCount.record(); int qSize = queryCount.value(recordCount.indexOf("hd_pcid")).toInt();
C++ (Qt)int qSize = queryCount.value(0).toInt;
C++ (Qt)queryCount->next()
C++ (Qt)QSqlQuery queryCount;QSqlRecord recordCount;queryCount.exec("SELECT COUNT(hd_pcid) FROM hardware_data WHERE hd_pcid = '"+pc_id+"'");queryCount.next();recordCount = queryCount.record();int qSize = queryCount.value(recordCount.indexOf("hd_pcid")).toInt(); //queryCount.value(0).toInt(); QString strCount; strCount.setNum(qSize); lineEdit->setText(strCount);
sqlite> select count(hd_pcid) from hardware_data where hd_pcid = '2';3sqlite>
C++ (Qt)queryCount.exec("SELECT COUNT(hd_pcid) AS pc_count FROM...int qSize = queryCount.value(recordCount.indexOf("pc_count")).toInt();
C++ (Qt) QString pc_id = FMain::trWd_tree->currentItem()->text(3); QSqlQuery query, queryCount; QSqlRecord record, recordCount; queryCount.exec("SELECT COUNT(hd_pcid) AS pc_count FROM hardware_data WHERE hd_pcid = '"+pc_id+"'"); queryCount.next(); recordCount = queryCount.record(); int qSize = queryCount.value(recordCount.indexOf("pc_count")).toInt(); //queryCount.value(0).toInt();//= QString new_id; new_id.setNum(qSize); lineEdit->setText(new_id); lineEdit_2->setText(queryCount.lastError().text());
C++ (Qt) QString pc_id = FMain::trWd_tree->currentItem()->text(3); QSqlQuery query, queryCount; queryCount.prepare("SELECT COUNT(hd_pcid) AS pc_count FROM hardware_data WHERE hd_pcid =:hd_pcid"); queryCount->bindValue(":hd_pcid", pc_id); queryCount->exec(); queryCount.next(); int qSize = queryCount.value(0).toInt(); QString new_id; new_id.setNum(qSize); lineEdit->setText(new_id); lineEdit_2->setText(queryCount.lastError().text());
if (queryCount.exec())
if (recordCount.isEmpty())