Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.86 KB | None | 0 0
  1.  Dim results As DataTable = newDt.AsEnumerable().Distinct().CopyToDataTable()
  2.         For Each row As DataRow In results.Rows
  3.  
  4.             Dim info As ProductInfo = New ProductInfo(CStr(row("ProdName")).Trim, row("displayname"), row)
  5.  
  6.             products.Add(info)
  7.         Next
  8.  
  9.     End Sub
  10.     Public Class ProductInfo
  11.         Public ProductName As String
  12.         Public MillName As String
  13.         Public CarbonTable As New DataTable
  14.  
  15.         Public Sub New(ByVal bajs1 As String, ByVal bajs2 As String, ByVal dtRow As DataRow)
  16.             ProductName = bajs1
  17.             MillName = bajs2
  18.             CarbonTable = addDatarow(dtRow)
  19.         End Sub
  20.  
  21.         Public Function addDatarow(ByVal row As DataRow) As DataTable
  22.             CarbonTable.Clear()
  23.             CarbonTable.ImportRow(row)
  24.  
  25.             Return CarbonTable
  26.         End Function
  27.     End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement