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
Solved

converting stored procedure results into an xml file

Posted on 2008-09-30
6
359 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
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…

856 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