Quote Originally Posted by fubao View Post
I don't even use Double datatype in my code, even though I assume it come from CDec function.
I set a condition to make the value in it to 0 when it is null (code not included), it still get error
If you are calling CDec than you are using doubles, so presumably somewhere you are reading what looks like an empty string, or a single space and trying to convert it to a double - that is what is failing.

Checking for null and setting it to 0 would work if you are actually getting a null, if it is anything other than a null or a double you will still get an error.

My advice would be to look at using something like Double.TryParse or even String.IsNullOrWhiteSpace to check your values and act accordingly.