Unsolved data from database is not shown
I have a form which is QMAINWINDOW and connected to Microsoft SQL Server database with some DROPBOXE and TABLEVIEWS when i receive data from database the boxes and tableview does not shown the data but i have rows number correctly but when i popup a QDialog window from my main the drop box in qdialog window show all the data in database.
all the setting for both forms are same like each other.
i have changed QMainWindow class to QDialog class nothing has changed.
all data came from same database.
Hi and welcome to devnet,
You are talking about QMainWindow and QDialog but you posted on the Qt Quick subforum, so which technology are you using ?
In any case, you should provide relevant samples of your code so people can analyse it to help you determine what is going on.
yes you right my wrong i`ll repost it in correct place with my code TY .
I solved the problem by accident.
after I used QSqlQuery.exec the data in data table will NOT SHOW if and only if I use QSqlDatabase::database().close();
so when i remove this part of code all the data where apeared perfectlly.
@Codmasters Because QSqlDatabase::close() does actually close the database so how should the query get it's data afterwards?