We help IT Professionals succeed at work.

Help dealing with nulls.

NickMalloy
NickMalloy asked
on
203 Views
Last Modified: 2010-04-23
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
Comment
Watch Question

Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.