PackTombstoneKey Method

Converts the row key from the specified table into the format used for the row key in the tombstone table.

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

Syntax

'Declaration
Public Function PackTombstoneKey ( _
    tableName As String, _
    columnValues As Object() _
) As Byte()
'Usage
Dim instance As SqlCeChangeTracking
Dim tableName As String
Dim columnValues As Object()
Dim returnValue As Byte()

returnValue = instance.PackTombstoneKey(tableName, _
    columnValues)
public byte[] PackTombstoneKey(
    string tableName,
    Object[] columnValues
)
public:
array<unsigned char>^ PackTombstoneKey(
    String^ tableName, 
    array<Object^>^ columnValues
)
member PackTombstoneKey : 
        tableName:string * 
        columnValues:Object[] -> byte[] 
public function PackTombstoneKey(
    tableName : String, 
    columnValues : Object[]
) : byte[]

Parameters

  • columnValues
    Type: array<System. . :: . .Object> [] () [] []
    An array that contains the column values of the row key.

Return Value

Type: array<System. . :: . .Byte> [] () [] []
An array of bytes that represents the value of the row key in the tombstone table.

Exceptions

Exception Condition
ArgumentException

The specified table does not exist

-or-

No row key has been defined for the specified table.

-or-

The number of elements in columnValues is different than the number of columns in the row key defined for the specified table.

ArgumentNullException

tableName is null

-or-

columnValues is null

Remarks

The row key uniquely identifies each row in a tracked table to the tracking system. The row key can either be the primary key of the table or a column of type uniqueidentifier that has the ROWGUIDCOL attribute applied (ROWGUID column). The type of row key used for a table is specified by passing one of the values of TrackingKeyType when tracking is enabled on the table.

The tombstone table (__sysOCSDeletedRows) uses a generic representation of this value stored in the __sysRK column. The __sysRK column uniquely identifies data in the tombstone table associated with a specific row of a specific tracked table.

In the case where the row key is a primary key that consists of a single column or where the row key is the ROWGUID column, the columnValues array should have a single element: the value of that column. However, in the case of a primary key that consists of multiple columns, the columnValues array should contain the values of each of the columns in the row that make up the primary key. The columns should be positioned in the array in the order in which they are defined in the primary key definition; that is, columns defined earlier in the primary key definition should have a lower index in the array than those defined after them.

See Also

Reference

SqlCeChangeTracking Class

SqlCeChangeTracking Members

System.Data.SqlServerCe Namespace

EnableTracking

TrackingKeyType