How to translate
select *from
(
select EmployeeID,FirstName,LastName,Region from Employees where city
in ('London','Seattle')
)
x
where x.Region is not null
into Linq Equivalent.
I tried (But null values also get selected)
LinqDBDataContext Context = new LinqDBDataContext();
var query = from emps in
(
from empls in Context.Employees
where empls.City == "London" || empls.City == "Seattle"
&& empls.Region != null
select new
{
FirstName = empls.FirstName,
LastName = empls.LastName,
City = empls.City,
Region = empls.Region
}
)
select emps;
GridView1.DataSource = query;
GridView1.DataBind();