This documentation is archived and is not being maintained.

ColumnAttribute.IsVersion Property

Gets or sets whether the column type of the member is a database timestamp or version number.

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

public bool IsVersion { get; set; }

Property Value

Type: System.Boolean
Default value = false.

Version numbers are incremented and timestamp columns are updated every time that the associated row is updated.

Note the following when IsVersion is true:

  • Use DbType to specify the correct modifiers to designate a version number or timestamp column. If you do not specify DbType, LINQ to SQL infers the correct modifiers.

Version numbers are incremented and timestamp columns are updated every time that the associated row is updated. Members with IsVersion=true are synchronized immediately after the data row is updated. The new values are visible after SubmitChanges finishes.

[Column(Storage = "_VersionNum", DbType = "Int NOT NULL IDENTITY", IsVersion=true)]
public int VersionNum
{
    get
    {
        return this._VersionNum;
    }

    set
    {
        if ((this._VersionNum != value))
        {
            this._VersionNum = value;
        }
    }
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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
Show: