fareed.fd7 says:
decimal total = dt.AsEnumerable().Sum(row => row.Field<decimal>("TotalAmount"));
First make sure that TotalAmount field should be decimal in the datatable. If this is string then change with the below code.
decimal d = 0;
decimal total = dt.AsEnumerable().Where(row => decimal.TryParse(row["TotalAmount"].ToString(), out d)).Sum(row => d > 0 ? d : 0);