I cannot get LIKE to work in the following scenario (Like and Field are initialized, just using a snippet...):
query.prepare("SELECT Name, CustomerID FROM Customer WHERE ? LIKE ?");
query.addBindValue(Field);
query.
addBindValue(QString("%%1\%").
arg(Like
));
query.exec();
QString Like; QString Field;
query.prepare("SELECT Name, CustomerID FROM Customer WHERE ? LIKE ?");
query.addBindValue(Field);
query.addBindValue(QString("%%1\%").arg(Like));
query.exec();
To copy to clipboard, switch view to plain text mode
Bookmarks