SqlException.GetObjectData Method (SerializationInfo, StreamingContext)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sets the SerializationInfo with information about the exception.

Namespace:   System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(
	SerializationInfo si,
	StreamingContext context


Type: System.Runtime.Serialization.SerializationInfo

The SerializationInfo that holds the serialized object data about the exception being thrown.

Type: System.Runtime.Serialization.StreamingContext

The StreamingContext that contains contextual information about the source or destination.

Exception Condition

The si parameter is a null reference (Nothing in Visual Basic).

GetObjectData sets a SerializationInfo with all the exception object data targeted for serialization. During deserialization, the exception is reconstituted from the SerializationInfo transmitted over the stream.

.NET Framework
Available since 1.1
Return to top