This documentation is archived and is not being maintained.

SerializationInfo.AddValue Method (String, DateTime)

.NET Framework 1.1

Adds a DateTime value into the SerializationInfo.

[Visual Basic]
Overloads Public Sub AddValue( _
   ByVal name As String, _
   ByVal value As DateTime _
public void AddValue(
 string name,
 DateTime value
public: void AddValue(
 String* name,
 DateTime value
public function AddValue(
   name : String,
 value : DateTime


The name to associate with the value, so it can be deserialized later.
The DateTime value to serialize.


Exception Type Condition
ArgumentNullException The name parameter is a null reference (Nothing in Visual Basic).
SerializationException A value has already been associated with name.


Trying to add the same name twice into the SerializationInfo is an error. The names are compared using an ordinal comparison, so it is possible, but not advisable, to have two names that differ only by case.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SerializationInfo Class | SerializationInfo Members | System.Runtime.Serialization Namespace | SerializationInfo.AddValue Overload List