Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I dont know why i am getting the following exception how can I cast into grouping Row ? What does grouping row means

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
127 views
Welcome To Ask or Share your Answers For Others

1 Answer

Quick 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".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...