This documentation is archived and is not being maintained.

DataColumn.MaxLength Property

Gets or sets the maximum length of a text column.

[Visual Basic]
Public Property MaxLength As Integer
public int MaxLength {get; set;}
public: __property int get_MaxLength();
public: __property void set_MaxLength(int);
public function get MaxLength() : int;
public function set MaxLength(int);

Property Value

The maximum length of the column in characters. If the column has no maximum length, the value is –1 (default).


The MaxLength property is ignored for non-text columns.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataColumn Class | DataColumn Members | System.Data Namespace