Results 1 to 11 of 11

Thread: Sql Server cannot retrieve data from select

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Sql Server cannot retrieve data from select

    Quote Originally Posted by Atomino
    after executing .first is False and also isValid.
    The query object initially points to a place before the first record --- you have to invoke QSqlQuery::next() to fetch the data.

    Qt Code:
    1. QSqlQuery psql("SELECT Nome FROM Anagrafica", db);
    2. if( psql.next() ) {
    3. // do something with psql.value( 0 )
    4. }
    5. else {
    6. // empty result set
    7. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to jacek for this useful post:

    fnmblot (6th September 2006)

Similar Threads

  1. Sql Server and PDF files
    By kroenecker in forum General Programming
    Replies: 4
    Last Post: 26th June 2007, 10:50
  2. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. connect to sql server
    By raphaelf in forum Qt Programming
    Replies: 15
    Last Post: 27th February 2006, 18:06
  5. synching client readings to server output
    By OnionRingOfDoom in forum Qt Programming
    Replies: 14
    Last Post: 28th January 2006, 18:15

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
  •  
Qt is a trademark of The Qt Company.