开发者

Not able to fetch the record if only one record is present, using QSqlite

开发者 https://www.devze.com 2023-03-31 13:31 出处:网络
I am trying to fetch the records from the table. I am able to get all the records except the first record.

I am trying to fetch the records from the table. I am able to get all the records except the first record.

Same way if there is only one record, then that record is also not fetched.

How could I get the only record present in my table.

I am using Qt, QSqlite and trying to get the records using QSqlQuery.next() function.

Like:

while(query.next())

What shoul开发者_开发技巧d I do to get all the records?


try to place the function QSqlQuery.first() before the while it place the db pointer to the first record so it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消