Handling Null Values in a Strongly Typed Dataset
In a typed dataset, you can control the representation of columns that contain null values. This behavior is only available when retrieving column values through their typed accessors. If you retrieve the value by means of the table's row index or column index, you will not be able to set the return value.
To set the value to return when a DataColumn's value is null
- Open the dataset in the XML Designer.
- Select an Element whose type is NOT an unnamed (or anonymous) type.
- In the Properties window, select the NullValue property.
- Do one of the following:
- From the drop-down list select the appropriate value:
- - or -
- Set the property to any custom value.