Want to convert CSV to XML, using this code:
// test person
var person = new Person("Jim", "TestJob", 1000);
var fileStream = new FileStream("sample.xml", FileMode.Create);
var writer = XmlDictionaryWriter.CreateTextWriter(fileStream);
var dcs = new DataContractSerializer(typeof(Person));
// Use the writer to start a document.
writer.WriteStartDocument(true);
// Use the writer to write the root element.
writer.WriteStartElement("Company");
// Use the writer to write an element.
writer.WriteElementString("Name", "Microsoft");
// Use the serializer to write the start,
// content, and end data.
dcs.WriteObject(writer, person);
// Use the writer to write the end element and
// the end of the document
writer.WriteEndElement();
writer.WriteEndDocument();
// Close and release the writer resources.
writer.Flush();
fileStream.Flush();
fileStream.Close();
Problem I have, no tabs, why is that?
After adding some tabs, the code that is generated seems to be right too!
Should I ignore it? Can this be done? Already searched around but not much to found about the tabs themselves.