Here you find some informations about arrays in .NET and C#:
http://msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspx[
^]
I think that array is not good choice in this case. Why not to use Dictionary?
Assuming that you are storing data in gridView in fields like this: InvoiceId (Int32) and TotalAmount (Double), try to use this code:
var invoices = new Dictionary<int,double>()
for (int i = 0; i < gridView2.RowCount; i++)
{
invNo = gridView2.GetRowCellValue(i, "InvoiceId");
invAmount = gridView2.GetRowCellValue(i, "TotalAmount");
invoices.Add(invNumber, invAmount);
}
The you can iterate through you dictionary like this:
foreach (int invoiceId in invoices.Keys)
{
double invoiceAmount = invoices[invoiceId]
Console.WriteLine(string.Format("Invoice: {0}, Total amount: {1}", invoiceId, invoiceAmount));
}
Hope that help you :)