Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (18.29 KB, 2 trang )
The DataColumn Class
You use an object of the DataColumn class to represent a column. You can also store
multiple DataColumn objects in a DataRow. Table 11.6
shows some of the DataColumn
properties.
Table 11.6: DataColumn PROPERTIES
PROPERTY TYPE DESCRIPTION
AllowDBNull bool Gets or sets a bool value that indicates whether null
values are allowed in this DataColumn object. The
default is true.
AutoIncrement bool Gets or sets a bool value that indicates whether the
DataColumn object automatically increments the
value of the column for new rows. The default is
false.
AutoIncrementSeed long Gets or sets the starting value for the DataColumn
object. Applies only when the AutoIncrement
property is set to true. The default is 0.
AutoIncrementStep long Gets or sets the increment used. Applies only when
the AutoIncrement property is set to true. The default
is 1.
Caption string Gets or sets the caption for the column. The caption
for the column is shown in Windows forms. The
default is null.
ColumnName string Gets or sets the name of the DataColumn object.
ColumnMapping MappingType Gets or sets the MappingType of the DataColumn
object. This determines how a DataColumn is saved
in an XML document using the WriteXml() method.
DataType Type Gets or sets the .NET data type used to represent the
column value stored in the DataColumn object. This
can be Boolean, Byte, Char, DateTime, Decimal,