DataColumn.MaxLength 属性

定义

获取或设置文本列的最大长度。

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

属性值

列的最大长度(以字符数表示)。 如果列没有最大长度,则默认值为 -1 (默认) 。

属性

注解

MaxLength对于非文本列,将忽略 属性。 ArgumentException如果分配给MaxLength非字符串列,则会引发异常。

适用于

另请参阅