How to write NOT IN condition in LINQ for int type

Posted by Rickeybglr under ASP.NET on 3/12/2013 | Points: 10 | Views : 1256 | Status : [Member] | Replies : 1
can someone help me in linq to entity .. here is my sql query, i need same in LINQ
select debt.PROJECT_NAME,debt.ID from table1 debt
join table2 detail on debt.PRID = detail.PRID join
table3 erp on detail.EXP = erp.EXP
where
debt.SECID not in(10,20,30,40,50,60)
AND detail.EXPID = 10




Responses

Posted by: Kusumas on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

dc.Log = Console.Out;

var query =

from c in dc.Customers

where !(from o in dc.Orders

select o.CustomerID)

.Contains(c.CustomerID)

select c;

foreach (var c in query) Console.WriteLine( c );

follows below link it will help you..........
http://introducinglinq.com/blogs/marcorusso/archive/2008/01/14/the-not-in-clause-in-linq-to-sql.aspx

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response