Share via


StringLengthValidationException Constructor (String, String, Int32, Int32, Int32, Exception)

Initializes a new instance of the StringLengthValidationException class with a specified message, the specified parameters, and inner exception that is the cause of this exception.

Namespace:  Microsoft.CommerceServer
Assembly:  Microsoft.CommerceServer.CrossTierTypes (in Microsoft.CommerceServer.CrossTierTypes.dll)

Syntax

'Declaration
Public Sub New ( _
    message As String, _
    propertyName As String, _
    minLength As Integer, _
    maxLength As Integer, _
    actualLength As Integer, _
    inner As Exception _
)
'Usage
Dim message As String
Dim propertyName As String
Dim minLength As Integer
Dim maxLength As Integer
Dim actualLength As Integer
Dim inner As Exception

Dim instance As New StringLengthValidationException(message, _
    propertyName, minLength, maxLength, _
    actualLength, inner)
public StringLengthValidationException(
    string message,
    string propertyName,
    int minLength,
    int maxLength,
    int actualLength,
    Exception inner
)
public:
StringLengthValidationException(
    String^ message, 
    String^ propertyName, 
    int minLength, 
    int maxLength, 
    int actualLength, 
    Exception^ inner
)
public function StringLengthValidationException(
    message : String, 
    propertyName : String, 
    minLength : int, 
    maxLength : int, 
    actualLength : int, 
    inner : Exception
)

Parameters

  • message
    Type: System..::.String
    The error message that explains the reason for the exception.
  • propertyName
    Type: System..::.String
    Name of the property that violated the range constraint.
  • minLength
    Type: System..::.Int32
    Minimum value allowed for this property (represented in string).
  • maxLength
    Type: System..::.Int32
    Maximum value allowed for this property (represented in string).
  • actualLength
    Type: System..::.Int32
    Actual value of this property (represented in string).
  • inner
    Type: System..::.Exception
    The exception that is the cause of the current exception, or a nullNothingnullptra null reference (Nothing in Visual Basic) reference (Nothing in Visual Basic) if no inner exception is specified.

Remarks

If the inner parameter is not a nullNothingnullptra null reference (Nothing in Visual Basic) reference, the current exception is raised in a catch block that handles the inner exception.

StringLengthValidationException is thrown when an attempt is made to save an entity and at least one string property of that entity is not within the allowed length.

Permissions

See Also

Reference

StringLengthValidationException Class

StringLengthValidationException Members

StringLengthValidationException Overload

Microsoft.CommerceServer Namespace