Click here to Skip to main content
15,913,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
New to Xml i need to save the dataset value to a xml file.
Need some advice.
Below is my code.

DataSet ds = new DataSet();
           string connectionString = ConfigurationManager.ConnectionStrings["InvoiceConnectionString"].ConnectionString;
           SqlConnection conn = new SqlConnection(connectionString);
           string selectSql = "Select CompName,CompAdd,Tel,Fax,SalesPerson from CustomerDetails Where CusId =@cusid";
           SqlDataAdapter da = new SqlDataAdapter(selectSql, conn);
           da.SelectCommand.Parameters.AddWithValue("@cusid", cid);

           da.Fill(ds, "shipto");
           dv2.DataSource = ds.Tables["shipto"];


Thanks
Posted

1 solution

Check below link for same
Export DataSet to XML File[^]
 
Share this answer
 
Comments
Lancy.net 4-Feb-12 1:59am    
Thanks jai

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