The task is to convert the CSV file into XML.
var x = from line in File.ReadAllLines(@"d:\sample.txt")
where !line.StartsWith("#") && line.Length>0
let parts=line.Split(',')
select new
{
XmlFile= new XElement("root",
new XElement("ISBN",parts[0]),
new XElement("Title",parts[1])
)
};
Questions
1 ) How to dispose the stream (Using Statement with LINQ).
2) How to save the selection into "sample.xml" file?
3) How to bind an Xml file to GridView ?(Do i need to use XmlDataSource ?).
4) Using Linq is it possible to create XSD for my XML ? (without using XSD.exe).