Results 1 to 2 of 2

Thread: How to retrive data to QSqlQueryModel When Excute a SQL Procdure?

  1. #1
    Join Date
    Aug 2008
    Posts
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to retrive data to QSqlQueryModel When Excute a SQL Procdure?

    I Create a procdure in SQL Server 2005

    Qt Code:
    1. CREATE PROC procs_model_data_test
    2. AS
    3. BEGIN
    4. -- Do something
    5. ...
    6. --At the end,show the result.
    7. SELECT * FROM tbl_model_data_test
    8. END
    To copy to clipboard, switch view to plain text mode 

    When Execute such proc in the Qt Program
    Qt Code:
    1. QString szSQL = "EXEC procs_model_data_test";
    2. model.setQuery(szSQL);
    To copy to clipboard, switch view to plain text mode 
    However , the model has no records, do you have any idea? thank you!

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

    Default Re: How to retrive data to QSqlQueryModel When Excute a SQL Procdure?

    What does QSqlQuery::isSelect() return?
    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.


Similar Threads

  1. QSqlQueryModel data update
    By psi in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2012, 03:59

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.