Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to save data from my database into xml file. I am using asp.net and C#.
The xml file will be save in client pc. I want to do this for faster calculation.
I will save data in xml file. Then calculation will be performed based on that xml file.
Or anyone can give me better solution.
Is there any one to help me?
Posted

1 solution

There are several ways to do that
1. Use the ExecuteXmlReader() method to run a SELECT statement that returns XML.

2.
C#
// Populate DataSet using Database
   SqlDataAdapter objSQLADP = new SqlDataAdapter("select * from tableName", "your_conn_str");
    DataSet ds=new DataSet;
    objSQLADP.Fill(ds,"tableName");
    ds.WriteXml("file.xml");  // Write Data into XML
 
Share this answer
 
Comments
raju melveetilpurayil 11-Oct-11 4:36am    
Good one, my 5

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