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());
}
QSqlQuery query("SELECT id,name FROM person");
while (query.next())
{
qDebug(query.value(0).toString().toAscii());
qDebug(query.value(1).toString().toAscii());
}
To copy to clipboard, switch view to plain text mode
and result is:
<-- nothing
Tom <-- first row name column value.
<-- nothing
Tom <-- first row name column value.
To copy to clipboard, switch view to plain text mode
Can anybody help me?
Bookmarks