1

In C#, can someone please inform me of the best data type that can have a string, string combination that can be serialized to xml and de serialized from xml?

I need to be able to have a list of this object, and the list can also be serialized to xml and de serialized from xml.

I have tried dictionary type, but this is causing errors when serializing to xml.

I am using object xml serialization for the serialization.

What data type should I use? Does such a data type exist?

Thanks

EDIT

I can serialize a List<string[]>, but am wondering if another data type does exist.

Simon
  • 7,991
  • 21
  • 83
  • 163
  • when you say two string ,is the first string attribute and the other value or how will the resulting XML look like eventually ? – Coder1409 Jun 04 '15 at 10:25
  • It is basically just a string string pair that I am looking for and I am using object xml serialization. So the xml looks different depending on the object type. – Simon Jun 04 '15 at 10:49
  • `NameValueCollection` is not supported too. – Amit Kumar Ghosh Jun 04 '15 at 11:00
  • List does what is required, but am wondering if there is a different data type that will work. – Simon Jun 04 '15 at 11:06
  • See here: http://stackoverflow.com/questions/3671259/how-to-xml-serialize-a-dictionary, or here: http://stackoverflow.com/questions/20787286/dictionary-xml-serialization, or here: http://stackoverflow.com/questions/12554186/how-to-serialize-deserialize-to-dictionaryint-string-from-custom-xml-not-us, or here: http://stackoverflow.com/questions/1799767/easy-way-to-convert-a-dictionarystring-string-to-xml-and-visa-versa – dbc Jun 04 '15 at 20:58

0 Answers0