|
-
Oct 10th, 2006, 04:25 PM
#1
Thread Starter
Hyperactive Member
Checking for null value in a field
I am reading data in a row using DataRow object. If there is null data in the column, then the following line of code is crashing. How can I check to see the content of the field is null before I do any other operation?
aDataRow.ItemArray[1].ToString() //fails because there is null value and Tostring() may not work.
If there is no Null value in this field, I want to convert that value to double. that part works.
Convert.ToDouble(aDataRow.ItemArray[1].ToString())
thanks
nath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|