Once a table has been filled with records, you can perform
maintenance operations on it such as changing some records or removing others.

Editing a record consists of changing one of the values of
the record under a particular column. There are various ways you can do this.
For a console application, the general steps you can (we will) follow are:

Make sure the table has at least one column that can be used to uniquely
identify each record. For example, when creating a table for employees, you
can assign a unique employee number to each staff member. The same would go
for students. If you are creating a table for a collection of items, such as
a book or a video collection, a commercial store that sells items such as
auto parts, make sure each item has a certain value that is unique to it,
such as a shelf number or a store number

Before editing a record, make the user aware of the existing values. You
can do this by displaying the records of the database

Request a value of the unique column from the user. For a table that
contains employees information, you can ask the user to enter the employee
number of the record to edit. The same would be for a book or video
collection, a commercial store that sells items, etc

After the user has indicated the record that will be modified, display the
particular values of that record

Asks the user to specify what particular column will receive the change

Request the new value from the user

After the user has entered the new value, change it

To finalize the record edition, save the row

To perform these steps, you use a combination of the
techniques we has reviewed so far: locate the table, display the records, locate
the record, locate the column, assign the value to the column of a record, save
the table.

Editing a Record by the Columns' Object Names

In the previous lesson, we saw that you could isolate a
record based on the object names of the columns such as Director or Title for a
table of videos. Once you have identified a column for a record, you can assign
the desired value. Here are examples:

We saw that another technique of recognizing a record was by
using the index of each column applied to the DataRow object of the
record. You can apply this concept to identify each column. Once you do, you can
then assign the desired value.