DataColumn.MaxLength Propriedade

Definição

Obtém ou define o tamanho máximo de uma coluna de texto.Gets or sets the maximum length of a text column.

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

Valor da propriedade

Int32

O tamanho máximo da coluna em caracteres.The maximum length of the column in characters. Se a coluna não tiver comprimento máximo, o valor será-1 (padrão).If the column has no maximum length, the value is -1 (default).

Atributos

Comentários

A MaxLength propriedade é ignorada para colunas que não são de texto.The MaxLength property is ignored for non-text columns. Uma ArgumentException exceção será gerada se você atribuir MaxLength a uma coluna que não seja de cadeia de caracteres.A ArgumentException exception is raised if you assign MaxLength to a non-string column.

Aplica-se a