My default decimal separator is "," when calling method myDataSet.GetXml() all decimal values from myDataSet are saving to XML with dot "." separator. The problem is, when I want to parse this XML back to myDataSet, and VS throws me Exception that decimal field accepts only decimal values, because of this separator.
Example how i get XML:
var xml = myDataSet.GetXml(); //Gives me XML with dots in decimals
Example how i try parse to DataTable:
var recordsDeleted = new DataTable(); //In my code I clone table from existing
recordsDeleted.Columns.Add("decimalFirst", typeof(decimal));
recordsDeleted.Columns.Add("decimalSecond", typeof(decimal));
recordsDeleted.Columns.Add("text", typeof(string));
var paramsToDataTable = new List<string> {"12.34","22.22","Foo"}; //This comes from XML
recordsDeleted.Rows.Add(paramsToDataTable.ToArray());
Please help me, how to change separator when saving to XML, or other solution to solve problem when parsing. Thanks!
GetXml()
you call it before callingGetXml()
in your new thread. – Biesi Grr