Returns an object using a unique key value. The key must be unique within this collection. If the collection's DatabaseObjects.Subset has been implemented then the key need only be unique within the subset specified, not the entire database table.

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

Syntax

C#
protected IDatabaseObject ObjectByKey(
	Object objKey
)
Visual Basic
Protected Function ObjectByKey ( _
	objKey As Object _
) As IDatabaseObject
Visual C++
protected:
IDatabaseObject^ ObjectByKey(
	Object^ objKey
)

Parameters

objKey
Type: System..::..Object
The key that identifies the object with this collection. The key is the value of the field defined by this collection's KeyFieldName.

Return Value

IDatabaseObject (DatabaseObjects.IDatabaseObject)

Examples

CopyC#
Default Public ReadOnly Property Item(ByVal strProductCode As String) As Product
    Get

        Return MyBase.ObjectByKey(strProductCode)

    End Get
End Property

See Also