The answer 1 is good.
As an alternative if you want to use
LINQ
then the following code can be used
data.AsEnumerable().Where(dr => dr.Field<string>(4)=="e")
.Select(dr => dr.SetField<string>(4,"z")).Count();
Where
data
is the
DataTable
The
LINQ
has deferred execution, so it will not execute the query until the sequence returned is iterated or a scalar function like Count is called. Hence,
Count
is called in the above code to immediately execute the query.