Remove Duplicate rows records from DataTable c#

Our Reader Score
[Total: 0 Average: 0]
Overview: This article explains how to remove duplicate records from DataTable in C#. In SQL Server database if a table contains duplicate records then it is easy to select unique records by using DISTINCT built-in Ms-SQL function and get duplicate free rows. But when a Dot.NET c# DataTable contains duplicate records then, we have to do something extra work to get duplicate-free records in datatable.

In many blogs on similar article, you find they use For loop, Dataview, Array List and delete duplicate rows over looping etc for removing duplicate rows.
Here i will show you a simple and much faster way, in this article I create a function which gives unique records from a DataTable in C#.NET and return a clean and duplicate free record DataTable which will copy to new datatable variable and get clean duplicate free distinct records.


On page load below written code will return distinct DataTable row records, i.e Remove duplicated rows.

This is our DataBinding method

Yeah, we are done 🙂

Hope you enjoyed this tutorial. If you have any recommendations, please let us know what you think in the comment section below! See you again next time!

Get your Printable Copy


  1. That is the simplest solution I have ever seen to this common situation. I’ll be using this approach from now on. Nice one!