Im not sure if this ought to work, since I always use value() method to get the selected columns.
If it shoud work at all, it might have to be bound as "out" or inout variable, the default is however QSql::in
In case your intention is to dynamically change column names of the query, maybe this is a solution:
query.prepare(QString("select %1 from mytable").arg("foo"));




Reply With Quote
Bookmarks