DisplayFormatAttribute::ConvertEmptyStringToNull Property

 

Gets or sets a value that indicates whether empty string values ("") are automatically converted to null when the data field is updated in the data source.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

public:
property bool ConvertEmptyStringToNull {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true if empty string values are automatically converted to null; otherwise, false. The default is true.

Users might enter an empty string for a field value. Use the ConvertEmptyStringToNull property to specify whether an empty string value is automatically converted to null when the data field is updated in the database.

System_CAPS_noteNote

By default, a DynamicField object displays null values as empty strings. To display a different value, set the NullDisplayText property.

The following example shows how to use the ConvertEmptyStringToNull to enable the conversion of empty string values to null.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Return to top
Show: