Results 1 to 3 of 3

Thread: Retrieve of the data from the database..?

  1. #1
    Join Date
    Nov 2014
    Posts
    54
    Thanks
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Retrieve of the data from the database..?

    Hi i am trying to retrive the data from the database here is my program

    Intially i am entering the mobile no in a line edit which i have named it as "searchedit" and then i am strong the data of line edit into a string and then i am trying to reterive the data from the database by the help mobile number which is present in the string and i have written the query as beolw

    QString str1 = searchedit->text();
    searchedit->setText(str1);

    int ret;
    QSqlQuery query;
    query.exec("SELECT * FROM details WHERE mobile="(str1.data())"");

    i am storing the data in a line edit into a string and then i am trying to retrive the data from the database which matches with the data present in the string,but it is showing an error " '"SELECT * FROM details WHERE mobile="' cannot be used as a function"

    I need to retirve the details of the user by the help of their mobile numbers.

    Please help to retrive the data from the data base i am using the sqlite database and my QT version is 4.7.4

    Thanks in advance
    Rohith.G

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Retrieve of the data from the database..?

    Duplicate of http://www.qtcentre.org/threads/6233...o-Retrive-data. Do not multipost please.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2014
    Posts
    54
    Thanks
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Retrieve of the data from the database..?

    Ok Sorry...!
    Will never repeat this...

Similar Threads

  1. Replies: 2
    Last Post: 8th March 2014, 15:12
  2. Sql query to retrieve database table data
    By Cyrebo in forum Qt Programming
    Replies: 9
    Last Post: 30th March 2013, 18:20
  3. problem while retrieve data from XML
    By asma_ramadan in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 26th July 2011, 11:30
  4. Replies: 2
    Last Post: 14th September 2009, 08:38
  5. Replies: 2
    Last Post: 14th September 2009, 08:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.