Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Help dealing with nulls.

I am trying to figure out the cleanest way to do something
If I am adding rows to a datatable like below, what is the best way to assign a zero if a value in the row is null?

While dr.Read
                newrow = dt.NewRow
                newrow("Unit") = dr("Unit")
                newrow("One") = dr("One")
                newrow("DT") = dr("DT")
                dt.Rows.Add(newrow)
            End While
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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