views:

230

answers:

2

Hi, I'm 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

+1  A: 

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

Garcia Julien
+1  A: 

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

Sharique