Unsolved Too long to load data from Sql Server
-
because if i don't use the query model then when click to Xem push button, it's work
and if i use the query model. it takes about 30s to load data from SQL Server.
Version is Qt Creator 4.14.0 -
@Duy-Khang said in Too long to load data from Sql Server:
click to Xem push button, it's work
?
Version is Qt Creator 4.14.0
we don't care which IDE (and it's version) you use - we want to use what Qt version you're using for developing.
-
Sorry for my English. i'm using Qt5
-
I assume @Duy-Khang is using 5.15.2 MinGW (the debug output, you can see in the screenshot). So it's probably not some weird buggy behavior
@Duy-Khang have you tried any other query or any other database? Can you print the query result to console?
Set breakpoints to see where it crashes (during the query execution or while filling your tableView/model with data). -
okay, let me try it!
-
@Duy-Khang
Can we be clear whether it is specifically because you useQSqlQueryModel
that you are seeing slow behaviour?What is the timing if you just use:
query = new QSqlQuery("SELECT * FROM Lecturer_DATABASE");
?
And what about:int count = 0; query = new QSqlQuery("SELECT * FROM Lecturer_DATABASE"); while (query.next()) qDebug() << ++count;
-
it's also takes about 10s to execute
-
@Duy-Khang
Which one takes 10 seconds? The 1-liner, the 4-liner, both? -
The 1-liner
-
@Duy-Khang
OK, so finally how long does this take:query = new QSqlQuery("SELECT 'Hello'");
Assuming you say 10 seconds, you must have something pretty odd going on with your connection/driver....
-
this is my video to show my problem. Plz help me !
https://drive.google.com/file/d/12_C6PmJRdoeVUsmoyumu7B6TaHL9k8mJ/view?usp=sharing
-
@Duy-Khang
How does the video clarify anything?
Do you think we do not understand what you have asked so far?
How would you like someone to help you when we don't know why it doesn't work for you?
Best of luck....