I have a datatable and I want to create a text file using this datatable. I want that each row of the newly created text file is unique. If there is a duplicate row, then it should add * to both rows ( duplicate rows)
I am using following code:
Dim str As String
For Each row As DataRow In dataTable.Rows
str += row(1) ' This is text data
str += "<br/>"
Next
Please suggest me how to make the rows unique.
Thanks
For my example I used an array with the data, but just replace the array part with your DataTable and you should be good to go. Basically you build a List of strings with the DataTable information then use LINQ to check and see if that data already exists once, or more than once.
The results string is