×

Discussion Board

Results 1 to 3 of 3

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    31

    How to insert data in sqlite database

    I 've conncet a local database in my app folder,and have succsee connect the database
    however when i try to do the folloing codes.

    query.exec("CREATE TABLE history (trainline varchar,station varchar,start_p varchar,end_p varchar)");

    query.exec("insert into history values('K586','chengdu','guangzhou,'shenzhen') ");

    //The reuslut is it successfully create the table name history but it didnt inesert any data i descripe in the above codes.
    What was wrong?And how i should do ??
    I wonder...
    Hope your answer.

  2. #2
    Regular Contributor
    Join Date
    Mar 2012
    Posts
    144

    Re: How to insert data in sqlite database

    check query result code and post it here plz

  3. #3
    Registered User
    Join Date
    Sep 2012
    Posts
    31

    Re: How to insert data in sqlite database

    My query code is
    query.exec("select * from history");
    //Then i use qDebug() and display it .However it did nothing .

Similar Threads

  1. SQLite database and QML
    By angusr in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-03-29, 16:28
  2. cannot insert data to database
    By curiousthinker in forum Python
    Replies: 2
    Last Post: 2010-05-08, 14:34
  3. SQLite and or other database.
    By shawty in forum Mobile Java General
    Replies: 6
    Last Post: 2010-03-26, 11:22
  4. Can't insert data in my database
    By jensesaat in forum Symbian C++
    Replies: 2
    Last Post: 2006-11-09, 10:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •