PDA

View Full Version : How to retrive data to QSqlQueryModel When Excute a SQL Procdure?



bangqianchen
19th March 2009, 01:35
I Create a procdure in SQL Server 2005



CREATE PROC procs_model_data_test
AS
BEGIN
-- Do something
...
--At the end,show the result.
SELECT * FROM tbl_model_data_test
END


When Execute such proc in the Qt Program


QString szSQL = "EXEC procs_model_data_test";
QSqlQueryModel model;
model.setQuery(szSQL);

However , the model has no records, do you have any idea? thank you!

wysota
19th March 2009, 09:20
What does QSqlQuery::isSelect() return?