Hi there,
I have an XML dox like this:
<?xml version="1.0" encoding="utf-8"?>
<Server Manufacturer="SQL" Version="1">
<Database Name="Test123" >
<Devices>
<Device Name="Testdata" ..../>
<Device Name="Testlog" ..../>
</Devices>
</Database>
</Server>
I want to deserialize it like this: var database = (Database)xmlSerializer.Deserialize(new StreamReader(xmlFilePath));
where Database is a Class with a collection of Devices.
It works fine when I comment out the Server tags in the XML file but i don't want to. I get an error saying "There is an error in XMl document line (1, 4)"
How can I tell the serialize to ignore the server tag and do I need to put a namespace in the XML file?
I tried putting [XmlRootAttribute("Database")] on the Database object but I still get the same error