tags:

views:

92

answers:

2

I am trying to read an XML file into a data set using dataset.ReadXml(fileName, XmlReadMode.IgnoreSchema). XML contains data formatted in French eg 231,23 ie '.' in US is replaced by ',' in French. I get an exception Input string was not in a correct format.Can any one help me ?

A: 

While debugging take a look at the value of your dataset.Locale.NumberFormat.NumberDecimalSeperator property -- it is probably '.' by default and you'd want to change it to ',' before reading in the XML.

East of Nowhere
+1  A: 

Set your culture info to fr-FR

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR")

The parsing should not fail.

Karel Frajtak