DuplicateNameException Constructors

Definition

Initializes a new instance of the DuplicateNameException class.

Overloads

DuplicateNameException()

Initializes a new instance of the DuplicateNameException class.

DuplicateNameException(String)

Initializes a new instance of the DuplicateNameException class with the specified string.

DuplicateNameException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the DuplicateNameException class with serialization information.

DuplicateNameException(String, Exception)

Initializes a new instance of the DuplicateNameException class with the specified string and exception.

DuplicateNameException()

Initializes a new instance of the DuplicateNameException class.

public:
 DuplicateNameException();
public DuplicateNameException ();
Public Sub New ()

Applies to

DuplicateNameException(String)

Initializes a new instance of the DuplicateNameException class with the specified string.

public:
 DuplicateNameException(System::String ^ s);
public DuplicateNameException (string? s);
public DuplicateNameException (string s);
new System.Data.DuplicateNameException : string -> System.Data.DuplicateNameException
Public Sub New (s As String)

Parameters

s
String

The string to display when the exception is thrown.

Applies to

DuplicateNameException(SerializationInfo, StreamingContext)

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the DuplicateNameException class with serialization information.

protected:
 DuplicateNameException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected DuplicateNameException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected DuplicateNameException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Data.DuplicateNameException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.DuplicateNameException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Data.DuplicateNameException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.DuplicateNameException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

The data that is required to serialize or deserialize an object.

context
StreamingContext

Description of the source and destination of the specified serialized stream.

Attributes

See also

Applies to

DuplicateNameException(String, Exception)

Initializes a new instance of the DuplicateNameException class with the specified string and exception.

public:
 DuplicateNameException(System::String ^ message, Exception ^ innerException);
public DuplicateNameException (string? message, Exception? innerException);
public DuplicateNameException (string message, Exception innerException);
new System.Data.DuplicateNameException : string * Exception -> System.Data.DuplicateNameException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

The error message that explains the reason for the exception.

innerException
Exception

The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.

Applies to