Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ Sqlite QT-Creator
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
Edited 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
0 Zoltán Zörgő 300
1 /\jmot 180
2 CHill60 145
3 Peter Leow 140
4 CPallini 135
0 Sergey Alexandrovich Kryukov 9,383
1 OriginalGriff 6,881
2 Peter Leow 4,607
3 Zoltán Zörgő 4,284
4 CHill60 2,892

Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2015
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