Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can I convert datable to xml and save the xml file to a folder path?
Posted

Use WriteXml() to write XML data in a File:
C#
DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable();

// Add datatable to dataset object
dataSet.Tables.Add(dataTable);

// Save to a file
dataSet.WriteXml(@"C:\MyData.xml");

// Read from a file
dataSet.ReadXml(@"C:\MyData.xml");
 
Share this answer
 
You wouldn't get answers this way.

First this is not a proper question.
I see 3 unrelated questions here:
- How do I get data from database ?
- How do I convert data to XML ?
- How do I save the XML in a particular folder ?

Where are you stuck ? What have you done ?

Quote:
How can I convert datable to xml and save the xml file to a folder path?
Trivial answer: By programming.
But for this, you have to learn to use the libraries needed to accomplish the task.
 
Share this answer
 
Comments
vignesht50 16-Nov-15 1:11am    
I have a DB table value in a datatable. Now I need to convert that datatable value to a xml file and save it in a folder.
Patrice T 16-Nov-15 1:21am    
Use Improve question to add details in the question itself.
Show what you have done.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900