hi all, first post so pls dont be hard with me :p
well i have this code and i dont know why it says error pls check it :
double total = 0.0;
int size = _receipt.Count;
for (int i = 0; i <= size; i++)
{
if ((Receipt)_receipt[i] is ItInvoices) //the ERROR is in this line
{
ItInvoices itinvoi = (ItInvoices)_receipt[i];
total = total + itinvoi.getNeto();
}
else
{
Ticket tick = (Ticket)_receipt[i];
total = total + tick.getNeto();
}
Console.WriteLine(total);
}
the ERROR says: The index was outside the interval. It must be a nonnegative and inferior value to the size of the collection. Name of the parameter: index