Re: export SQL query to XML
What's the problem exactly? Seems like an easy task.
Re: export SQL query to XML
it seems as if i would query the data then write that to an xml
how would i go about doing so
Re: export SQL query to XML
Ok, but which part of the task you are having problems with? Did you look at available classes? Which seemed like ones that might suit the task? Did you do any research about the subject or do you just expect someone to give you a ready solution so that you don't have to bother?
Re: export SQL query to XML
i dont expect anyone to write anything i wont learn that way
i have been researching but cant get a grasp on what would i use as my container like would i use a sqlquerymodel to hold my data and then write the model to xml using dom or stream
Re: export SQL query to XML
It seems you are on the right track. What's the problem then?
Re: export SQL query to XML
well writing the document if i have a query like
Code:
SELECT *
FROM advertisementstrings
WHERE advertisementstrings.LanguageID = '1'
and i would like to have
<root>
<myinfo>
</myinfo>
</root>
Re: export SQL query to XML
I still fail to see the problem :) You have QSqlQuery or QSqlQueryModel to execute the query and QDomDocument or QXmlStreamWriter to write the data to xml (my personal choice would be to go for QSqlQuery and QXmlStreamWriter in this case but that's mostly a matter of taste unless your query is going to return thousands of rows). For such an easy document you can even write to the file directly instead of using any xml tools, there is not much processing here.
If you ask a specific question then I will do my best to give you a specific answer but so far I haven't seen any questions here (not even a single question mark in your posts).
Re: export SQL query to XML
sorry i will explain
i have a device (linux) that will connect to MYSQL Database to gather information but sometimes it will not have internet connection to get data from webserver this is why im trying to get sql data then write to xml on local hdd and read from there when no internet connection is available
im sorry to confuse and not explain im new to qt
if there is an easier way to do this please let me know but as far as i can see xml would be good to store on local hdd for access
Re: export SQL query to XML
XML is ok. You could also use an SQLite database. There is an additional benefit in this case that it's not that trivial to modify the contents of such file if you care about integrity of the data.
Re: export SQL query to XML
SQL error sorry!! ignore this post
Re: export SQL query to XML
Ok so i have done what you have suggested (Fairly easy) so i get why i was confused :)
Thanks wysota