// get the value of the "horaInicio" column
DateTime horaInicio = (DateTime)row.Cells["horaInicio"].Value;
// get the value of the "horaFim" column
DateTime horaFim = (DateTime)row.Cells["horaFim"].Value;
// calculate the duration between the two times
TimeSpan duration = horaFim - horaInicio;
// set the value of the "resultado" column to the duration in hours
row.Cells["resultado"].Value = duration.TotalHours;
// get the value of the "horaInicio" column
DateTime horaInicio = (DateTime)row.Cells["horaInicio"].Value;
// get the value of the "horaFim" column
DateTime horaFim = (DateTime)row.Cells["horaFim"].Value;
// calculate the duration between the two times
TimeSpan duration = horaFim - horaInicio;
// set the value of the "resultado" column to the duration in hours
row.Cells["resultado"].Value = duration.TotalHours;