Hello -
Total newbie here. I've googled until I've gone crazy and can't find what I need.
I have two arraylists. One called productList and one called priceList. They are both in a loop and I want to be able to multiply them every time the loop goes through. This isn't the exact code - but it gets my point across (these two arrays will always have the exact same amount of items in them):
But, whenever I try to do this I get:
Specified cast is not valid.
or
When casting from a number, the values must be a number less than infinity.
I get this even when I try casting the lists. I hope this makes sense. I'm a total newb and way confused. Any help is appreciated!!
Total newbie here. I've googled until I've gone crazy and can't find what I need.
I have two arraylists. One called productList and one called priceList. They are both in a loop and I want to be able to multiply them every time the loop goes through. This isn't the exact code - but it gets my point across (these two arrays will always have the exact same amount of items in them):
Code:
for (int i = 0; i, productList.Count; i++)
{
productList[i] * priceList[i]
}
But, whenever I try to do this I get:
Specified cast is not valid.
or
When casting from a number, the values must be a number less than infinity.
I get this even when I try casting the lists. I hope this makes sense. I'm a total newb and way confused. Any help is appreciated!!