# LINQ not equal to operator RSS

## 5 replies

Last post May 06, 2012 01:38 AM by Decker Dong - MSFT

Member

19 Points

62 Posts

### LINQ not equal to operator

hello all,

```var filter= from c in listB.AsEnumerable()
where c["Title"] != (from d in listA.AsEnumerable()
select d["Tilte"])
select c;```

I am getting all the records

I am unable to filter it..any help?

Star

8079 Points

1491 Posts

### Re: LINQ not equal to operator

try execpt

```var filter = from c in listB.AsEnumberable()
where c["Title"].Except((from d in listA.AsEnumberable()
select d["Title"])
select c;```
if it helps - Good luck!
Cheers!
Design And Align
- Rob

Star

9204 Points

1570 Posts

### Re: LINQ not equal to operator

Do you have a typing mistake?  You use "Title" and "Tilte".  Anyway;

```var filter = from c in listB
where !listA.Any(d => d["Title"] == c["Title"])
select c;```

Contributor

5088 Points

998 Posts

### Re: LINQ not equal to operator

Casting problem, so it doesnt check... change to

```var filter= from c in listB.AsEnumerable()
where Convert.ToString(c["Title"]( != (from d in listA.AsEnumerable()
select d["Tilte"]).Cast<string>()
select c;```

Mãsthän Oli
playingOOPS | மெய்ப்பொருள் காண்பதறிவு

Member

19 Points

62 Posts

### Re: LINQ not equal to operator

Thanks all of you.I found the solution

```var filter= from c in listB.AsEnumerable()
where !(from o in listA.AsEnumerable() select o["Title"]).Contains(c["Title"].ToString())
select c;```

• ### Decker Dong ...

All-Star

118619 Points

18779 Posts

### Re: LINQ not equal to operator

```var names =