It would all depend on how you are receiving the data. Personally, I would create a struct to hold each invoice state, then I would hold a List of invoices. Then you could use the GroupBy extension, something like this
struct invoice
{
public int id { get; set; }
public string invoice { get; set; }
}
List<invoice> invoices = new List<invoice>();
var groupedInvoices = invoices.GroupBy(i => i.id);
hope this helps