ClientDataSet.First;while not ClientDataSet.eof dobegin ClientDataSet.edit; ClientDataSet.FieldByName('行号字段').asInteger := ClientDataSet.RecNo; ClientDataSet.next;end;