Group By datatable using dataview | Filtering datatable using dataview | Distinct Datatable

I would like to implement a "Group By" for my datatable. Here i am using Dataview.

Example:
   Sample Datatable..


Datatable it contains many columns but i need to group based on Uid column.

Solution:
Syntax:
                      Dim dtv As New DataView(datatable)
      datatable = dtv.ToTable(True, "Column1", "Column2" ...)

Example:
   Dim dtgroup As DataTable = Nothing
                    Dim dtv As New DataView(dtbrImport)
                    dtgroup = dtv.ToTable(True, "Uid")

Result:

Post a Comment

0 Comments