Solved

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

Posted on 2007-03-30
3
640 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
Comment Utility
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
Comment Utility
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
Comment Utility
If Cadency is 0, it will go to the second option in the IIF, and will divide by 0.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Contant UI messages in .NET 1 40
Wpf develop 5 29
Expando 4 33
Enable copy and pasting even when textbox is disabled 2 14
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now