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
There is no Distinct() method syntax in the language integrated query syntax. The closest you could do would be to move the current call:
Distinct()
var q = (from c in tbl select c.TABLE_TYPE).Distinct();