query.prepare( "INSERT INTO Clients (ExpUserName, Password, FirstName, LastName,Email, Phone, CreateDate, LastModified, HarpGroup, isActive) VALUES (:ExpUserName,:Password, :FirstName, :LastName, :Email, :Phone, :CreateDate, :LastModified, :HarpGroup, :isActive)");
query.bindValue( ":ExpUserName", expUserIDEdit->displayText() );
query.bindValue( ":Password", passwordEdit->displayText() );
query.bindValue( ":FirstName", firstnameEdit->displayText() );
query.bindValue( ":LastName", lastnameEdit->displayText() );
query.bindValue( ":Email", emailEdit->displayText() );
query.bindValue( ":Phone", phoneEdit->displayText() );
query.
bindValue( ":CreateDate",
QDate::currentDate().
toString("dd,mm,yyyy") );
query.
bindValue( ":LastModified",
QDate::currentDate().
toString("dd,mm,yyyy") ) ;
query.bindValue( ":HarpGroup", harpGroupCB->currentText() );
query.bindValue( ":isActive", 1);
if(!query.exec())
qDebug() << "> Query exec() error." << query.lastError();
else
qDebug() << ">Query exec() success.";
QSqlQuery query;
query.prepare( "INSERT INTO Clients (ExpUserName, Password, FirstName, LastName,Email, Phone, CreateDate, LastModified, HarpGroup, isActive) VALUES (:ExpUserName,:Password, :FirstName, :LastName, :Email, :Phone, :CreateDate, :LastModified, :HarpGroup, :isActive)");
query.bindValue( ":ExpUserName", expUserIDEdit->displayText() );
query.bindValue( ":Password", passwordEdit->displayText() );
query.bindValue( ":FirstName", firstnameEdit->displayText() );
query.bindValue( ":LastName", lastnameEdit->displayText() );
query.bindValue( ":Email", emailEdit->displayText() );
query.bindValue( ":Phone", phoneEdit->displayText() );
query.bindValue( ":CreateDate", QDate::currentDate().toString("dd,mm,yyyy") );
query.bindValue( ":LastModified", QDate::currentDate().toString("dd,mm,yyyy") ) ;
query.bindValue( ":HarpGroup", harpGroupCB->currentText() );
query.bindValue( ":isActive", 1);
if(!query.exec())
qDebug() << "> Query exec() error." << query.lastError();
else
qDebug() << ">Query exec() success.";
To copy to clipboard, switch view to plain text mode
Bookmarks