DataColumn.MaxLength 属性   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置文本列的最大长度。
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, setPublic Property MaxLength As Integer属性值
列的最大长度(以字符数表示)。 如果列没有最大长度,则默认值为 -1, (默认) 。
- 属性
注解
MaxLength对于非文本列,将忽略 属性。 ArgumentException如果分配给MaxLength非字符串列,则会引发异常。