DataColumn.AutoIncrementSeed Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the starting value for a column that has its AutoIncrement property set to true. The default is 0.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

Public Property AutoIncrementSeed As Long

Property Value

Type: System.Int64

The starting value for the AutoIncrement feature.

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

.NET Framework
Available since 1.1
Return to top
Show: