The KeyFieldAttribute should specify the field name that uniquely identifies each object within the collection. As opposed to the ordinal/index position or distinct field, the key field provides another method of accessing a particular object within the collection. The key field must be unique within the collection. If the SubsetAttribute has been specified then the key field only needs to be unique within the subset, not the entire table. Specifying this attribute is optional.

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
public class KeyFieldAttribute : Attribute
Visual Basic
Public Class KeyFieldAttribute _
	Inherits Attribute
Visual C++
public ref class KeyFieldAttribute : public Attribute

Examples

CopyC#
<KeyField("CustomerName")>
Public Class Customers
    ...

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    DatabaseObjects..::..KeyFieldAttribute

See Also