In this post we are exploring more about DataColumn class.
We use an object of the DataColumn class to represent a column. We can store multiple DataColumn
objects in a DataRow.
Here some of the DataColumn properties:
Sr.No
|
Property
|
Type
|
Description
|
1)
|
AllowDBNull
|
bool
|
Gets or sets a bool value that indicates whether null values are allowed in this DataColumn object.
|
2)
|
AutoIncrement
|
bool
|
Gets or sets a bool value that indicates whether the DataColumn object automatically increments the value of the column for new rows.
|
3)
|
AutoIncrementSeed
|
long
|
Gets or sets the starting value for the DataColumn object. Only applies when the AutoIncrement property is set to true.
|
4)
|
AutoIncrementStep
|
long
|
Gets or sets the increment used. Only applies when the AutoIncrement property is set to true.
|
5)
|
Caption
|
string
|
Gets or sets the caption for the column. The caption for the column is shown in Windows forms.
|
6)
|
ColumnName
|
string
|
Gets or sets the name of the column.
|
7)
|
DataType
|
Type
|
Gets or sets the type of data stored in the DataColumn object. This can be Boolean, Byte, Char, DateTime, Decimal, Double, Int16, Int32,
Int64, SByte, Single, String, TimeSpan, UInt16, or UInt64.
|
8)
|
DefaultValue
|
object
|
Gets or sets the default value for the DataColumn when new rows are created.
|
9)
|
MaxLength
|
int
|
Gets or sets the maximum length of text that may be stored in a DataColumn object.
|
10)
|
Ordinal
|
int
|
Gets the numeric position of the DataColumn object (0 is the first object).
|
11)
|
ReadOnly
|
bool
|
Gets or sets a bool value that indicates whether the DataColumn object can be changed once it has been added to a DataRow.
|
12)
|
Table
|
DataTable
|
Gets the DataTable to which the DataColumn object belongs.
|
13)
|
Unique
|
bool
|
Gets or sets a bool value that indicates whether the DataColumn values in each DataRow object must be unique.
|
No comments:
Post a Comment
Please do not enter any spam link in the comment box.