Jason,
If you are using SQL Server 2005, check out the FOR XML syntax for your
query. It will allow the results to be returned as XML. You can then use
the ExecuteXmlReader method on the SqlConnection class to get an XmlReader
you can use to read XML from the query.
Additionally, for any data back end, you can just populate a dataset,
then call the WriteXml method to write the data set to a stream in XML
format. You can then transform or use it any way you like.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Jason Huang" <Ja************@hotmail.com> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
Hi,
In my C# windows form project, I would like to have a function which will
write the SQL query result into an XML file.
Would someone tell me how to do this?
Thanks for help.
Jason