Hello I might have strings for example "1,1" or "1.1" or "1" or "" and from each of them I need to get results in same format so it can be saved in SQL Db as numeric (8,2)
var ci = CultureInfo.InvariantCulture.Clone() as CultureInfo;
prikaz.Parameters.AddWithValue("@p_ub_c", Decimal.Parse(p_ub_c.Text.Replace(',', '.') == string.Empty ? "0.00" : p_ub_c.Text, ci));
Passed string is: "2500,00" but can be also "" or "2500.00"
Those values needs to be saved in sql numeric(8,2)
And when the textbox p_ub_cis empty then string is 0 and I got this: System.FormatException input string was not in correct format.
May someone help me solve this out?
Thank you for your time
Decimal.Parse?p_ub_c.Text.Replace(',', '.') == string.Empty ? "0.00" : p_ub_c.Text, ci, You should not have,since you replaced them..