I have a method to check the duplicate in the column of a DataTable.
public void ChkDuplicacy(DataTable dt)
{
try
{
var dup_result =
from c in dt.AsEnumerable()group c by new
{
RowId = c.Field("SYMBOL_NO")}
into g
where g.Count() > 1
select new
{
g.Key.RowId
};
if (dup_result.ToList().Count > 0)
{
for (int i = 0; i < dup_result.ToList().Count; i++)
{
var item = dup_result.ToList()[i];
}
}
}
catch (Exception)
{
throw;
}
}When I debug this code, for the code block the varibale var item is having values as </div> <div>
RowId = "12345" RowId = "75395"
I want to extract only the right side values i.e., 12345, 75395 as a List. How can I do that ? Also I have to return this List. How can I do this? Please help!!!