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 _
)
[C#]
public void AddValue(
 string name,
 DateTime value
);
[C++]
public: void AddValue(
 String* name,
 DateTime value
);
[JScript]
public function AddValue(
   name : String,
 value : DateTime
);

Parameters

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

Exceptions

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

Remarks

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.

Requirements

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

Show: