Click here to Skip to main content
13,409,546 members (39,202 online)
Rate this:
Please Sign up or sign in to vote.

I just need help with my project. I am using Qt creator for Mobile symbian OS.
I just would like to know what is the best Insert Command to enable the user to save input data into SQLite.

I have this code:
void addtrnsc::on_pushButton_clicked()
    QSqlDatabase myDB = QSqlDatabase::addDatabase("QSQLITE");

    if (!
        QMessageBox::critical(0, tr("no Con"), tr("unable to stablish"));

    QSqlQuery query;
    query.exec("insert into expense values(Descrition, Amount, Type, Date) VALUES ("+ui->txtDescrip->text()+","+ui->txtamount->text()+","+ui->comboxtype->currentText()+","+ui->dateEdit->text());

or can you give me a sample logic that will insert input data to databse..

I do not know if what is next and I do not know if it will work.
Can someone please help me with this?

Posted 25-Jan-13 12:37pm
Updated 25-Jan-13 13:15pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This will help with your insert statement,[^]

INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180221.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100