DataColumn.MaxLength Propriedade

Definição

Obtém ou define o comprimento máximo de uma coluna de texto.

public:
 property int MaxLength { int get(); void set(int value); };
[System.Data.DataSysDescription("DataColumnMaxLengthDescr")]
public int MaxLength { get; set; }
public int MaxLength { get; set; }
[<System.Data.DataSysDescription("DataColumnMaxLengthDescr")>]
member this.MaxLength : int with get, set
member this.MaxLength : int with get, set
Public Property MaxLength As Integer

Valor de Propriedade

O comprimento máximo da coluna em caracteres. Se a coluna não tiver comprimento máximo, o valor é -1 (por defeito).

Atributos

Observações

A MaxLength propriedade é ignorada para colunas que não são de texto. Uma ArgumentException exceção é criada se atribuir MaxLength a uma coluna que não seja de string.

Aplica-se a

Ver também