void SqliteHelper
::insertData(const int &recordid,
const int &controlid,
const QString &value,
const int &dataid
) {
sqlQuery.prepare("INSERT INTO data (recordid, controlid, value, dataid) VALUES (:recordid,:controlid,:value,:dataid)");
sqlQuery.bindValue(":recordid", recordid);
sqlQuery.bindValue(":controlid", controlid);
sqlQuery.bindValue(":value", value);
sqlQuery.bindValue(":dataid", dataid);
if (sqlQuery.exec())
{
emit successExecute(sqlQuery.lastQuery());
}
else
{
emit errorExecute(sqlQuery.lastQuery(), sqlQuery.lastError().driverText());
}
}
void SqliteHelper::insertData(const int &recordid, const int &controlid, const QString &value, const int &dataid)
{
QSqlQuery sqlQuery(this->sqlDb);
sqlQuery.prepare("INSERT INTO data (recordid, controlid, value, dataid) VALUES (:recordid,:controlid,:value,:dataid)");
sqlQuery.bindValue(":recordid", recordid);
sqlQuery.bindValue(":controlid", controlid);
sqlQuery.bindValue(":value", value);
sqlQuery.bindValue(":dataid", dataid);
if (sqlQuery.exec())
{
emit successExecute(sqlQuery.lastQuery());
}
else
{
emit errorExecute(sqlQuery.lastQuery(), sqlQuery.lastError().driverText());
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks