converting stored procedure results into an xml file

Hi
I am running a stored procedure in Oracle which connects to a database and then runs a Select Query. I need to copy the results from the Select Query into an XML file. I cant seem to find the information that I need for this. Any help would be greatly appreciated as I am a newbie in C# and XML.

many thanks

Dawnyanne
dawnyanneAsked:
Who is Participating?
 
WilliamCommented:
These should get you started...
 DataSet FromXML( string XMLFileName )
        {
            DataSet ds = new DataSet();
            ds.ReadXml( XMLFileName , XmlReadMode.Auto );
            return ds;
        }
 
        string ToXMLFile( DataSet ds )
        {
            string temp = System.IO.Path.GetTempFileName() + ".xml";
            ds.WriteXml( temp , XmlWriteMode.WriteSchema );
            return temp;
        }

Open in new window

0
 
WilliamCommented:
You can save your results to a dataset and then from the dataset out to xml...
If you need more info please let me know
0
 
dawnyanneAuthor Commented:
Hi Billy
Thanks for coming back to me - could you give me some more details? could you tell me how I save it to a dataset and then out to xml. Sorry to ask! Thankyou very much again.
kind regards
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
dawnyanneAuthor Commented:
Hi Billy
Just wanted to say thank you so much!  can i just ask - do i still use the streamwriter? I am floundering a bit!
many, many thanks!
Dawnyanne
0
 
WilliamCommented:
You can always use the streamwriter if you want...  I just usually use the file ver as it is a little easier on memory...  If your dataset is REALLY large you do not have to pass that mem chunk around...
0
 
dawnyanneAuthor Commented:
thank you so much for your help! I am sorry it has taken me so long to accept the solution!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.