| |||||||||||||
DataColumn.AutoIncrement PropertySystem.Data Namespace DataColumn Class Returns or sets a value indicating whether the column automatically increments the value of the column for new rows added to the table. Syntax
Property ValueThis property accepts or returns only a boolean value: true if the value of the column increments automatically; otherwise, false. The default is false. Exceptions
RemarksIf the type of this column is not Int16, Int32, or Int64 when this property is set, the DataType property is coerced to Int32. An exception is generated if this is a computed column ( that is, the Expression property is set. ) the incremented value is used only if the row's value for this column, when added to the columns collection, is equal to the default value. You can create a new row using the DataRow class's ItemArray property and passing in an array of values. This is a potential problem for a column with its AutoIncrement set to true, because its value is generated automatically. To use the ItemArray property, place a null reference in the column's position in the array. For more details, see the DataRow class's ItemArray property. ExampleThe following example sets the AutoIncrement, AutoIncrementSeed, and AutoIncrementStep properties.
See AlsoDataColumn Members AutoIncrementSeed AutoIncrementStep Expression ItemArray NewRow |
| ||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme