Defining a primary key for a table (this memory table datatable sets the primary key)

Source: Internet
Author: User

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"]};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.