josepvr
18th May 2011, 14:24
hello,
i'm implementing a routine that reads row data from SQLITE db.
I want to read id and the other fields.
I can get other fields data correctly, but id data is null.
my code is:
QSqlQuery query("SELECT id,name FROM person");
while (query.next())
{
qDebug(query.value(0).toString().toAscii());
qDebug(query.value(1).toString().toAscii());
}
and result is:
<-- nothing
Tom <-- first row name column value.
Can anybody help me?
i'm implementing a routine that reads row data from SQLITE db.
I want to read id and the other fields.
I can get other fields data correctly, but id data is null.
my code is:
QSqlQuery query("SELECT id,name FROM person");
while (query.next())
{
qDebug(query.value(0).toString().toAscii());
qDebug(query.value(1).toString().toAscii());
}
and result is:
<-- nothing
Tom <-- first row name column value.
Can anybody help me?