zoukankan      html  css  js  c++  java
  • Defining a Primary Key for a Table(该内存表DataTable 设置主键)

    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.
    一个数据表都有一个或者是若干个列,而每个表都可以有唯一标识列的字段,这些能够标识字段的列就是所谓的主键。

    When you identify a single DataColumn as the PrimaryKey for a DataTable, the table automatically sets the AllowDBNull property of the column to false and the Unique property to true. For multiple-column primary keys, only the AllowDBNull property is automatically set to false.
    当你为确定一个列为数据表的主键的时候,表会自动为该列设置非空的属性。如果主键的内容涵盖多个列,那么这些列也都为非空。

    The PrimaryKey property of a DataTable receives as its value an array of one or more DataColumn objects, as shown in the following examples. The first example defines a single column as the primary key.

    例子:
    workTable.PrimaryKey = new DataColumn[] {workTable.Columns["CustLName"], workTable.Columns["CustFName"]};
  • 相关阅读:
    金额与数字转化常用实用几个JS方法
    Jdb命令 The Java Debugger
    GLOBAL TEMPORARY TABLE
    安装与配置Nginx
    MySQL二进制安装与密码破解
    基于FPM构建企业RPM包
    安装Tomcat
    nginx配置优化
    DHCP原理及配置(三个小实验)
    DNS主、从服务器的配置
  • 原文地址:https://www.cnblogs.com/shineqiujuan/p/1210949.html
Copyright © 2011-2022 走看看