I have a textbox and a grid on a form.
Functionality: When I enter an Emp ID (say 1, 2, 3 etc) in textbox, corresponding to that Emp ID, Emp Name shoul
To define the order of records you have to use indexes/primary key. Add it like in code below.
Table1.FieldDefs.Add('EmpId', ftAutoInc, 0, True);
Table1.FieldDefs.Add('EmpName', ftString, 40);
Table1.IndexDefs.Add('idxEmpId','EmpId',[ixPrimary]);
Table1.CreateTable;
Table1.Open;
You can hide EmpId from viewing in grid by defining DBGrid.Columns property, where show only necessary columns.