Vyacheslav Lanovets wrote:
I want DataSet.WriteXML() to use NumberDecimalSeparator "." instead of ","
I don't think the result of WriteXml depends on the locale (or culture
as .NET calls it), for instance the output in the following example is
always the same, even if the culture is changed:
DataSet dataSet = new DataSet("DoubleTest");
DataTable dataTable = new DataTable();
dataTable.Columns.Add(new DataColumn("double", typeof(double)));
DataRow dataRow = dataTable.NewRow();
dataRow["double"] = 2.5;
dataTable.Rows.Add(dataRow);
dataSet.Tables.Add(dataTable);
dataSet.WriteXml(Console.Out);
Console.WriteLine();
string[] cultures = new string[] { "en-US", "en-GB", "de-DE", "de-CH"};
foreach (string cultureName in cultures) {
Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName);
Console.WriteLine("Culture is {0}. XML is: ",
Thread.CurrentThread.CurrentCulture);
dataSet.WriteXml(Console.Out);
Console.WriteLine();
}
The decimal separator there is always '.' as it should be for double data.
Perhaps I misunderstand what you try to do, please explain in more
detail if you still have problems.
--
Martin Honnen
http://JavaScript.FAQTs.com/