A database table commonly has a column, or group of columns, that uniquely identifies each row in the table. This identifying column or group of columns is called the primary key.
A data table has one or several columns, and each table can have fields that uniquely identify columns. These columns that can identify fields are called primary keys.
When you identify a singleDatacolumnAsPrimarykeyForDatatable, The table automatically setsAllowdbnullProperty of the columnFalseAndUniquePropertyTrue. For Multiple-column primary keys, onlyAllowdbnullProperty is automatically setFalse.
When you determine a column as the primary key of the data table, the table automatically sets a non-empty attribute for the column. If the primary key contains multiple columns, these columns are not empty.
ThePrimarykeyProperty ofDatatableEs as its value an array of one or moreDatacolumnObjects, as shown in the following examples. The first example defines a single column as the primary key.
Example:
Worktable. primarykey = new datacolumn [] {worktable. Columns ["custlname"], worktable. Columns ["custfname"]};