Don't DataTable and DataSets have a WriteXML() and WriteXmlSchema(), could those be used to help?
I don't think there is a native way in .NET to create an excel file.
You could make a CSV pretty easy from it though.
There may be no native way, but there is a
way using Interop.
can you post help regarding creating csv file?
It's fairly simple. You need to include System.IO, and then just create the file:
-
FileStream fs = new FileStream(@"c:\dev\test.csv", FileMode.Create);
-
StreamWriter sw = new StreamWriter(fs);
-
/////////
-
//This section: replace. Loop through your data, inserting commas between columns and newlines between rows.
-
sw.WriteLine("name,number");
-
sw.WriteLine("Curtis,10");
-
/////////
-
sw.Close();
-
fs.Close();
-
//always close your streams
-
And follow Plater's advice, find out more on rules of CSVs.