Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
6
Answers
Remove Duplicate Rows From DataTable in c#
Karthi Keyan
7y
1.5k
1
Reply
Hi,
I have DataTable. That have 2 Columns. one is Element, another one is Attribute. Element Column have duplicate. but Attribute not. i want to remove Entire row if is there any duplicate in Element Column. like Follow.
Element
Attribute
component/header
@[version = '1.2']
component/header/title
[cited = 'no']
@[type = 'series']
component/header/title[cited = 'no']
@[level = 'Product']
from this table i want remove 4th row. i tried to check while adding each row by DataTable.Select. but it return an error. because the Element having single quotes. Also i tried
dt.AsEnumerable().Distinct(DataRowComparer.Default);
but that's not help full. is there any idea about this.
Thanks in advance.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
How to configure Mathematics Formula in C# web application
Find slot no.'s of the connected usb's in USB Hub(10 slots)