Gets or sets the starting value for a column that has its AutoIncrement property set to true.
Namespace:
System.Data
Assembly:
System.Data (in System.Data.dll)
Visual Basic (Declaration)
Public Property AutoIncrementSeed As Long
Dim instance As DataColumn
Dim value As Long
value = instance.AutoIncrementSeed
instance.AutoIncrementSeed = value
public long AutoIncrementSeed { get; set; }
public:
property long long AutoIncrementSeed {
long long get ();
void set (long long value);
}
public function get AutoIncrementSeed () : long
public function set AutoIncrementSeed (value : long)
The following example sets the AutoIncrement, AutoIncrementSeed, and AutoIncrementStep properties.
Private Sub AddAutoIncrementColumn()
Dim column As DataColumn = New DataColumn
column.DataType = System.Type.GetType("System.Int32")
With column
.AutoIncrement = True
.AutoIncrementSeed = 1000
.AutoIncrementStep = 10
End With
' Add the column to a new DataTable.
Dim table As DataTable
table = New DataTable
table.Columns.Add(column)
End Sub
private void AddAutoIncrementColumn()
{
DataColumn column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.AutoIncrement = true;
column.AutoIncrementSeed = 1000;
column.AutoIncrementStep = 10;
// Add the column to a new DataTable.
DataTable table = new DataTable("table");
table.Columns.Add(column);
}
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
.NET Compact Framework
Supported in: 3.5, 2.0, 1.0
XNA Framework
Supported in: 3.0, 2.0, 1.0
Reference
Other Resources