I dont know why i am getting the following exception how can I cast into grouping Row ? What does grouping row means
See Question&Answers more detail:osI dont know why i am getting the following exception how can I cast into grouping Row ? What does grouping row means
See Question&Answers more detail:osQuick answer: change the code to
foreach(var InvoiceHeader in InvoiceHeadercollection)
The linq code has generated a new class, which you can think of like this:
class AutoGeneratedClass : IEnumerable<DataRow>
{
public string Key { get; } // The InvoiceAccount field
}
(It's not called "AutoGeneratedClass"; I'm just using that so it follows the syntax we know). Because there's no name for this automatically generated class, you have to use "var".