开发者

Pivot Table in LINQ in VB.NET

开发者 https://www.devze.com 2022-12-25 02:00 出处:网络
I\'m 开发者_Python百科looking for doing a Pivot Table query in vb.net. I\'ve found a lot of code in c# but not in VB.Net and i don\'t understand how to convert c# to VB.

I'm 开发者_Python百科looking for doing a Pivot Table query in vb.net. I've found a lot of code in c# but not in VB.Net and i don't understand how to convert c# to VB.

Can you help me?

Thanks

Ju


I found the response:

Dim query = From final In _
                    (From lh In Me.AnnualCost1.sp_annualcostLH _
                     Group lh By lh.Asset_Number Into Group) _
                Let Jan As Object = (From r In final.Group Where _
                r.Month = "January" _
                Select r.lhTotal).Sum _
                Select New With { _
                    .Asset_Number = final.Asset_Number, _
                    .January = If(Jan Is Nothing, 0, Jan) _
                    }

Thats generate a pivot Table with column by month. Here is only for january

Julien


You can use SharpDevelop to convert C# code to VB.net and reverse and also to few other languages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号