asp.net.ph

DataColumn.AutoIncrementSeed Property

System.Data Namespace   DataColumn Class


Sets or retrieves the starting value for a column that has its AutoIncrement property set to true.

Syntax


Script DataColumn.AutoIncrementSeed [ = intValue ]

Property Value


intValue The starting value for the AutoIncrement feature.

The property is read/write with no default value.

Example

The following example sets the AutoIncrement, AutoIncrementSeed, and AutoIncrementStep properties.

private void AddAutoIncrementColumn ( ) {
   DataColumn myColumn = new DataColumn ( );
   myColumn.DataType = System.Type.GetType ( "System.Int32" );

   myColumn.AutoIncrement = true;
   myColumn.AutoIncrementSeed = 1000;
   myColumn.AutoIncrementStep = 10;

   // add the column to a new DataTable.
   DataTable myTable = new DataTable ( "MyTable" );
   myTable.Columns.Add ( myColumn );
}
  C# VB

See Also

DataColumn Members   AutoIncrement   AutoIncrementStep   Expression   ItemArray Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 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 asp.net.ph