[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TDataSet.FieldByName

Search a field by name

## Declaration

Source position: db.pas line 1689

`public function TDataSet.FieldByName(`
`const FieldName: string`
`):TField;`

## Arguments

`FieldName` |  | Fieldname to look for.

## Function result

Field instance matching FieldName

## Description

FieldByName is a shortcut for Fields.FieldByName: it searches for the field with fieldname equalling FieldName. The case is performed case-insensitive. The matching field instance is returned.

## Errors

If the field is not found, an EDatabaseError exception will be raised.

## See also

TFields.FieldByname |  | Find a field based on its name
TDataset.FindField |  | Find a field by name