Link to home
Start Free TrialLog in
Avatar of Rick
Rick

asked on

asp.net - checking for Null values in datatables

This line is giving me, "Conversion from type 'DBNull' to type 'String' is not valid."

      strString = dt.Compute("SUM(Column1)", String.Empty)

How do I check for DBNull in a dataset?


Thank you.

Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

use IsDbNull method, check:
http://stackoverflow.com/questions/222834/handling-dbnull-data-in-vb-net

Note: is dt a datatable? Please provide more code
SOLUTION
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial