Solved

converting stored procedure results into an xml file

Posted on 2008-09-30
6
328 Views
Last Modified: 2013-11-15
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
0
Comment
Question by:dawnyanne
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:William
Comment Utility
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
 

Author Comment

by:dawnyanne
Comment Utility
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
 
LVL 11

Accepted Solution

by:
William earned 500 total points
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:dawnyanne
Comment Utility
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
 
LVL 11

Expert Comment

by:William
Comment Utility
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
 

Author Closing Comment

by:dawnyanne
Comment Utility
thank you so much for your help! I am sorry it has taken me so long to accept the solution!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now