dranizz
asked on
{"Cannot convert value 'Infinity' to Type: System.Int32."} when passing a 0 to type Int32
I have a DataColumn of Type Int32, when I try to pass it a value of 0 in code I get this exception:
{"Cannot convert value 'Infinity' to Type: System.Int32."}
Can someone explain and tell me how to do this without raising this exception?
{"Cannot convert value 'Infinity' to Type: System.Int32."}
Can someone explain and tell me how to do this without raising this exception?
Do you have any calculated columns in the dataset? Sounds like one of them is trying to divide by 0.
ASKER
Yes, that must be it, but my calculated columns has a formula that is testing if the value I use to divide is not 0.
Column 1 = Cadency
Column 2= QtyTotal
Column 3= NbrOfDays (Calculated Column)
NbreDays.Expression = " iif( QtyTotal > 1 AND QtyTotal < Cadency AND Cadency > 0 ,1, QtyTotal / Cadency)"
I still get an error, even if I won't make the division if it's 0.
Column 1 = Cadency
Column 2= QtyTotal
Column 3= NbrOfDays (Calculated Column)
NbreDays.Expression = " iif( QtyTotal > 1 AND QtyTotal < Cadency AND Cadency > 0 ,1, QtyTotal / Cadency)"
I still get an error, even if I won't make the division if it's 0.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.