>Oh, and thanks for the help. I have seen the .tostring before, but never bothered to ask why they used it.
You're welcome. I'll pretty much always use .ToString() instead of casting a DataColumn value to a string. It's probably slower (although I don't know), but since it seamlessly handles the DBNull.Value, it's worth it to me.
Just as an FYI, what I've done for all data types is to create a static GetNonNull() method (with many overloads for different default datatypes) in a CommonMethods class. Then, depending on what I pass it as a default, it returns either the value of the object passed in, or the default if that object is DBNull.Value.
int i = CommonMethods.GetNonNull(MyDataRow["MyColumn"], 0);
The method will return a zero if MyColumn contains DBNull.Value but will return the value of the column otherwise.
~~Bonnie