Solved

{"Cannot convert value 'Infinity' to Type: System.Int32."} when passing a 0 to type Int32

Posted on 2007-03-30
3
649 Views
Last Modified: 2013-11-26
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?
0
Comment
Question by:dranizz
  • 2
3 Comments
 
LVL 25

Expert Comment

by:dstanley9
ID: 18826545
Do you have any calculated columns in the dataset?  Sounds like one of them is trying to divide by 0.
0
 

Author Comment

by:dranizz
ID: 18845181
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.
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 250 total points
ID: 18845252
If Cadency is 0, it will go to the second option in the IIF, and will divide by 0.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question