Hi
I am having an usse retrieving a decimal value from a recordset, and putting it into a C# decimal type.
I am using the following code to do this (recordset is called dr):
If the decimal number is 10,000,000 or greater, then it causes a parse error. I think this is because from this size of number, it is returned in scientific notation and thus the parse method cannot handle it.
I have worked out that if I use
in the SQL stored procedure, it seems to fix the problem, but I would rather come up with a C# based fix. Any ideas?
I am having an usse retrieving a decimal value from a recordset, and putting it into a C# decimal type.
I am using the following code to do this (recordset is called dr):
Code:
decimal decNum = decimal.Parse(dr["decFld"].ToString());
If the decimal number is 10,000,000 or greater, then it causes a parse error. I think this is because from this size of number, it is returned in scientific notation and thus the parse method cannot handle it.
I have worked out that if I use
Code:
convert(decimal, decFld)