?
Solved

converting stored procedure results into an xml file

Posted on 2008-09-30
6
Medium Priority
?
380 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 2000 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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