Hello Team,
I am getting below error while fetching the unique value from excel column.(in C# language)
Can someone assist me to resolve this error or do we have another to do the same?
Thanks,
Riya
Hello Team,
I am getting below error while fetching the unique value from excel column.(in C# language)
Can someone assist me to resolve this error or do we have another to do the same?
Thanks,
Riya
Hi @Riya1
You have given linq expression is in vb which is absolutely correct.
You can try the below for C#
DT.AsEnumerable().Where(row => !string.IsNullOrEmpty(row["ColumnA"].ToString())).Select(row => row["ColumnA"].ToString()).Distinct().ToList()
Hope it helps!!
Hi @Riya1
Use below query
Uniquevalues = DT.AsEnumerable().Select(row => row["YourColumnName"].ToString()).Distinct().ToList();
Regards,