Exception when using T Field <T> in my code
I get an InvalidCastException when I try to use this code. I can not decide how to use the field. Plz help me
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 really want to get the value in the specified column Name and Row no from dataTable. _Transaction is the name of the table here
+3