dtList = dtList.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList();
I assumed empty string and whitespace are like null. If not you can use IsNullOrEmpty (allow whitespace), or s != null
dtList = dtList.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList();
I assumed empty string and whitespace are like null. If not you can use IsNullOrEmpty (allow whitespace), or s != null