Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qsqlquery problem [Solved]

    C++ Gurus
    2
    3
    1827
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      r.bhardwaj last edited by

      @
      void company_db::delete_item(int itmn)
      {
      QSqlQuery dlt_itm("delete from item where item_no= ?? ");
      }
      @
      how should i compare itemn(int) to item_no(int ) attribute of item table ? Because i have to pass itmn as a string within QsqulQuery constructor ??

      1 Reply Last reply Reply Quote 0
      • R
        r.bhardwaj last edited by

        that was very simple Ques. i got the ans
        @
        void company_db::delete_item(int itm_no)
        {
        QSqlQuery del_item;
        del_item.prepare("delete from item where item_no=(:tag)");
        del_item.bindValue(":tag",itm_no);
        del_item.exec();
        }
        @
        sry for disturbance ...

        1 Reply Last reply Reply Quote 0
        • M
          MaPet last edited by

          hi,
          pls set the thread to solved.
          edit the topic header and write [Solved] in front of it!
          br

          1 Reply Last reply Reply Quote 0
          • First post
            Last post