Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
DataColumn Class
 AutoIncrementSeed Property
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
DataColumn..::.AutoIncrementSeed Property

Updated: November 2007

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
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);
}
J#
/** @property */
public long get_AutoIncrementSeed()
/** @property */
public  void set_AutoIncrementSeed(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.

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);
}

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, 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

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: 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker