Hello all,

I am new in using qt and i would like some help. Currently i am trying to insert data to an sqlite db and i I get error, any ideas into what I might be doing wrong? The strings come from a Form's LineEdit fields. Please see below the code:

Qt Code:
  1. void Register::Register1()
  2. {
  3. QSqlQuery query;
  4. query.prepare("INSERT INTO User (pk, name, psw) "
  5. "VALUES ( :name, :psw)");
  6.  
  7. query.bindValue( ":name", ui.RUserNameLineEdit->text() );
  8. query.bindValue( ":psw",ui.RPassword->text() );
  9.  
  10.  
  11. if( !query.exec() )
  12.  
  13. qDebug() << "> Query exec() error." << query.lastError().type();
  14.  
  15. else
  16.  
  17. qDebug() << ">Query exec() success.";
To copy to clipboard, switch view to plain text mode 

Thank you !