Dim dt As New DataTable '' Create 3 typed columns in the DataTable. dt.Columns.Add("ConflictingPaper", GetType(String)) dt.Columns.Add("Numberofstudents", GetType(String)) dt.Columns.Add("AdminNo", GetType(String)) 'Dim query1 = (From a In dt3 Group Convert.ToString(a.Field(Of Integer)("PaperNo")) By AdminNo = (a.Field(Of String)("AdminNo")) Into Group Select dt.LoadDataRow(New Object() {String.Join(":", Group.ToArray()), Group.Count(), AdminNo}, False)).ToList().Count() Dim query = From r In dt3.AsEnumerable() Let adminno = r.Field(Of String)("AdminNo") Group r By adminno Into Group Select New With {.AdminNo = adminno, .numberofstudents = Group.Count(), .conflictingpaper = String.Join(":", Group.Select(Function(r) r.Field(Of Integer)("paperno").ToString()))} DataGridView3.AutoGenerateColumns = True DataGridView3.DataSource = query
DataGridView3.AutoGenerateColumns = True DataGridView3.DataSource = query
DataGridView3.AutoGenerateColumns = True DataGridView3.DataSource = query.ToList()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)