Hi Neha,
You are trying to compare int with string the query that leads to this problem I believe.
Try to see what you get in loc variable first
otherwise try to replace
var loc = (e.Row.Cells[1].Text);
with this line
var loc = Convert.ToInt32(e.Row.Cells[1].Text);
Updated solution:
Try this query and see what you get...
var locationID = from obj in context.PanchayatiRajLocations
where loc == "London"
select obj.ID;
Hope this helps you a bit.
Regards,
RK