DataColumn

The DataColumn object represents a column in a table. It contains information about the column itself rather than values stored in the column. For example, it holds the column’s name but not the column’s value for any given row.

The following sections explain some of the DataColumn’s most useful properties and methods.

AllowDBNull, MaxLength, ReadOnly, Unique, and DefaultValue

These properties set simple restrictions on the column’s values. These restrictions are not enforced until you finish making changes to the row containing the modified fields. For example, suppose you are using a DataGrid to edit address records. The State field has a MaxLength value of 2 but you enter the value Wash. You can continue to edit that entry and ...

Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.