4
Have a datatable
and needed to make a foreach
to change some values of this datatable
public static DataTable TabelaAmbientes { get; set; }
I was doing the following foreach:
foreach (DataRow lista in TabelaAmbientes.Rows)
{
switch (lista.CatRem_Tipo)
{
case "C":
lista.CatRem_Tipo = "Comissão/Participação";
break;
case "P":
lista.CatRem_Tipo = "Premiação";
break;
case "A":
lista.CatRem_Tipo = "Ambos";
break;
}
}
But in doing lista.CatRem_Tipo
me of the error of
Datarow does not contain a definition for Catrem_type
What can I do?
lista["CatRem_Tipo"].Value
???– Leandro Angelo
Where could I put this? on the switch not right
– Jeff Henrique