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"]};
  • 相关阅读:
    jQuery获取Select选择的Text和 Value(转)
    android学习---EditText
    android学习---Activity
    android学习---LinearLayout
    android学习---布局Layout
    android颜色码制表
    java面试题二
    java面试题一
    基本排序算法java实现
    Integer与int的区别
  • 原文地址:https://www.cnblogs.com/shineqiujuan/p/1210949.html
Copyright © 2011-2022 走看看