PDA

View Full Version : generate XML file using SQL database in QT



sam123
25th May 2016, 10:23
Hello
I have been working on the project of XML file generation. I have developed GUI using QT4 framework to enter, modify and delete data in SQL database (using tables). I am using Sql Query model for fetching data. After entering data in my database using GUI, I must create XML file of the same data.

I have confused with two way to generate xml files.

1. Shall I create query to generate XML file in SQL database and execute in QT using QSqlQuery?

2. Shall I derect use XML class in QT to generate XML file (make sure the data I have to use from database)?

which option would be easier in this case or if you can suggest me better option.

Looking for your best advice.

Thanks in advance....

anda_skoa
25th May 2016, 11:01
Does your database support direct XML export?

Cheers,
_

sam123
25th May 2016, 13:23
Thanks for reply.

yes I am using Microsoft SQL server. I can write a query to generate xml file in my database.

thanks

anda_skoa
25th May 2016, 14:15
Then that option sounds better to me than to pull values from the database and then generating XML.

Cheers,
_