I need to write decimal value to ms access database, but i have a problem with conversion values to decimal in different cultures. Have a values from file, which separates by commma. I try:
public decimal CSingleCulture (string str)
{
string sep = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
string s = str.Replace(",", sep);
return decimal.Parse(s);
}
if NumberDecimalSeparator = "."
then work is good, but if NumberDecimalSeparator = ","
problems begin... decimal.Parse(s)
always return vlaues separates by dot. In this situation, when inserted into a database error occurs.