DataColumn.MaxLength DataColumn.MaxLength DataColumn.MaxLength DataColumn.MaxLength Property

定義

取得或設定文字資料行的最大長度。Gets or sets the maximum length of a text column.

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

屬性值

資料行的最大長度,以字元為單位。The maximum length of the column in characters. 如果資料行沒有最大長度,則此值為-1 (預設值)。If the column has no maximum length, the value is -1 (default).

備註

MaxLength文字資料行的屬性會被忽略。The MaxLength property is ignored for non-text columns. 如果您指派MaxLength給非字串資料行,就會引發例外狀況。ArgumentExceptionA ArgumentException exception is raised if you assign MaxLength to a non-string column.

適用於

另請參閱