I have to fetch the top 20 rows using this query and the like clause is not working. Can anybody tell me why / help me find a solution?
var zipcodes = (from results in db1.ZipCodes1
where results.CityType == "D" && results.ZIPCode like '%ZC %'
select new Ajaxresults
{
ZIPCode= results.ZIPCode,
CityName = results.CityName,
StateAbbr = results.StateAbbr,
StateName = results.StateName
}).GroupBy(o => o.ZIPCode);
To select the top 20 rows, you should use the LINQ
Takeoperator