Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

divide by zero error 1

Status
Not open for further replies.

SavantMan

Programmer
Apr 17, 2002
165
US
Scenario:
A dataset exists with a number of columns in it. I want to add a new column that will divide ColA by ColB.

How I've accomplished this is pretty simple, simply create an instance of DataColumn, and set the .Expression property to ColA / ColB.

The problem is when I get to a row where ColB is 0, a divide by zero error occurs. This seems like it should be something so common that it would be heavily documented and such as to how to handle, but can't find anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top