O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required