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 Chriss Miller 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
Joined
Apr 17, 2002
Messages
165
Location
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.
 
Thanks mansii --- that handled what I needed.
 
The honor goes to him.
Thank's for the star.
:-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top