Solved

converting stored procedure results into an xml file

Posted on 2008-09-30
6
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:William
ID: 22606302
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
ID: 22608512
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
ID: 22608596
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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

Author Comment

by:dawnyanne
ID: 22613321
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
ID: 22614619
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
ID: 31501556
thank you so much for your help! I am sorry it has taken me so long to accept the solution!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

688 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