2011年6月9日 星期四

linq 教學(2) group by

--
Imports System.Linq
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mm() As Integer = {2, 2, 3, 1, 3, 8, 63, 2}
Dim qm = From xm In mm Select xm Group By xm Into Group
TextBox1.Text = ""
For Each a In qm
TextBox1.Text += a.xm.ToString + " || " + a.Group.ToString + vbCrLf
Next

End Sub
End Class

沒有留言:

張貼留言