Skip to content
Advertisement

How to get names of columns from table (Microsoft SQL Server)?

I need to get names of columns and save them in strings. SQL statement works correctly (I checked it in SQL manager).

Advertisement

Answer

After exec() use queryTem.next() which retrieves next record in the result until theres any record. And use QVector to store column name. Read more here about QVector.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement