Camillia
asked on
Simple LINQ select statement
What's wrong with this LINQ? I get 6 errors; "; expected" and "invalid expression term in".
I think the syntax is correct. I have using Sytem.LINQ on top of the page. I have also imported the namespace that contians the LINQ context.
I think the syntax is correct. I have using Sytem.LINQ on top of the page. I have also imported the namespace that contians the LINQ context.
EContext dc = new EContext();
var p = from c in dc.LSite //error here under "c", under "in" and under "dc"
where c.Code != "GBL" //error here looking for ; at the end.
select c;
foreach (var values in p)
{
lbSites.Attributes.Add(values.Code, values.Name);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
you were right ... i changed to "equal" but that "c" was also giving an error. Changed it and it works. Thanks.
ASKER