.NET Framework Class Library
DataColumn..::.AutoIncrementSeed Property

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)
Syntax

Visual Basic (Declaration)
Public Property AutoIncrementSeed As Long
Visual Basic (Usage)
Dim instance As DataColumn
Dim value As Long

value = instance.AutoIncrementSeed

instance.AutoIncrementSeed = value
C#
public long AutoIncrementSeed { get; set; }
Visual C++
public:
property long long AutoIncrementSeed {
    long long get ();
    void set (long long value);
}
JScript
public function get AutoIncrementSeed () : long
public function set AutoIncrementSeed (value : long)

Property Value

Type: System..::.Int64
The starting value for the AutoIncrement feature.
Examples

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

Visual Basic
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
C#
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);
}
Platforms

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.
Version Information

.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
See Also

Reference

Other Resources

Tags :


Page view tracker