Appcrash after sql statement with QString
-
Hello,
If i execute this sql-statement my app crashes if I change a ComboBox item
@
void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{if(!db.isOpen()) { qDebug() << "DB is not open!"; } QSqlQuery q; q.exec("SELECT * FROM autos WHERE snr = '"+ arg1 +"'"); }
@
If i use this it works...
@
void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{if(!db.isOpen()) { qDebug() << "DB is not open!"; } QSqlQuery q; q.exec("SELECT * FROM autos WHERE snr = '0588/835'"); }
@
why....???? :/