Is there way to rewrite:
var tbl = ds.TABLES; var q = from c in tbl select c.TABLE_TYPE; string s = \"\"; foreach (var item in q.Distinct()) { s
You may capture HashSet and put where clause before select:
var hs = new HashSet(); from c in "abcabcd" where hs.Add(c) select c;