0
votes

I have DataTable which contains decimal field. Also, I have xml file with data. In this file, decimals using comma separator instead of dot. When I try to run this code:

var xmlTextReader = new XmlTextReader(new StringReader(xmlText));
dataTable.ReadXml(xmlTextReader);

It throws exception "Input string was not in a correct format". How can I fix this?

1
Please add your xml text. Also, try to parse simple xml files first and continue with more critical ones to find the mistake.xoxox

1 Answers

1
votes

XML containing decimal values with comma is not a valid XML according to the XML specification. The specification states:

finite-length sequence of decimal digits (#x30-#x39) separated by a period as a decimal indicator