I am getting InvalidCastException when i am trying to use this code. I am not been able to resolve how to use Field. Plz help me out
DataTable _Transaction= new DataTable();
float NetAmount=0;
//Records inserted into Table
for (int i = 0; i < _Transaction.Rows.Count; i++)
{
NetAmount += _Transaction.Rows[i].Field<object>("ItemAmount");
}
EDIT I actually want to retrieve value at specified columnName and Row no from a dataTable. _Transaction is a name of table here