cydside
9th June 2009, 22:26
Hi to all,
I've compiled the following and "same" code:
void frmCategorie_AME::inserisciCampi()
{
QString querySQL;
querySQL = QString("INSERT INTO %1 VALUES (NULL,:primo,:secondo,1,0)")
.arg(listaNomiPerTabella["nomeTabella"].toString());
QSqlQuery queryInserimento;
queryInserimento.prepare(querySQL);
queryInserimento.bindValue(":primo", ui.lnePrimo->text());
queryInserimento.bindValue(":secondo",
ui.cboSecondo->itemData(ui.cboSecondo->currentIndex()));
if (queryInserimento.exec())
{
qDebug() << "INSERT OK!";
qDebug() << queryInserimento.lastInsertId.toInt();
}
else
{
QMessageBox::critical(this, tr("Attenzione!"),
tr("Il database ha riportato un errore: %1")
.arg(queryInserimento.lastError().text()));
}
queryInserimento.finish();
}
unbeliveble but the latest version(2009.02) give me back the following error:
src\frmCategorie_AME.cpp: In member function `void frmCategorie_AME::inserisciCampi()':
src\frmCategorie_AME.cpp:15: error: insufficient contextual information to determine type
make[1]: *** [debug/frmCategorie_AME.o] Error 1
qDebug() << queryInserimento.lastInsertId.toInt(); == insufficient contextual information to determine type
HELP!!!
:crying:
I've compiled the following and "same" code:
void frmCategorie_AME::inserisciCampi()
{
QString querySQL;
querySQL = QString("INSERT INTO %1 VALUES (NULL,:primo,:secondo,1,0)")
.arg(listaNomiPerTabella["nomeTabella"].toString());
QSqlQuery queryInserimento;
queryInserimento.prepare(querySQL);
queryInserimento.bindValue(":primo", ui.lnePrimo->text());
queryInserimento.bindValue(":secondo",
ui.cboSecondo->itemData(ui.cboSecondo->currentIndex()));
if (queryInserimento.exec())
{
qDebug() << "INSERT OK!";
qDebug() << queryInserimento.lastInsertId.toInt();
}
else
{
QMessageBox::critical(this, tr("Attenzione!"),
tr("Il database ha riportato un errore: %1")
.arg(queryInserimento.lastError().text()));
}
queryInserimento.finish();
}
unbeliveble but the latest version(2009.02) give me back the following error:
src\frmCategorie_AME.cpp: In member function `void frmCategorie_AME::inserisciCampi()':
src\frmCategorie_AME.cpp:15: error: insufficient contextual information to determine type
make[1]: *** [debug/frmCategorie_AME.o] Error 1
qDebug() << queryInserimento.lastInsertId.toInt(); == insufficient contextual information to determine type
HELP!!!
:crying: