how to convert sql to linq
-
using ef4 iam trying to convert this sql to linq but could not select s.IdSimcard ,s.Imei from dbo.SimCard s where s.Imei not in (select distinct d.Imei from dbo.SimCard d inner join dbo.Configuracion c on c.SinCard_IdSincard = d.IdSimcard where c.Estado = 'Activo' ) So far I have this with the help of linqpad, I cant use linquer anymore for the activation code (from s in SimCard where s.Imei.Contains( (from c in Configuracion join d in SimCard on c.SinCard_IdSincard equals d.IdSimcard where c.Estado == "Activo" select new { d.Imei }).Distinct()) select new { s.IdSimcard, s.Imei }) I have read "Not in" dont supported in EF4, what woul be the equivalent? i get this error in linqpad 'string.Contains(string)' - Argument 1: cant convert de 'System.Linq.IQueryable' to 'string'
-
Answer:
If I understand your question, you can use the Except(...) Extension method (in the System.Linq namespace) instead of Not Contains(...).
Diego_DX at Stack Overflow Visit the source
Related Q & A:
- How to convert below SQL Expression into derived column in SSIS?Best solution by Stack Overflow
- How to convert sql query to Hibernate Criteria query?Best solution by Stack Overflow
- How to convert my SQL query to MS Access query?Best solution by Stack Overflow
- How to convert SQL query to LINQ query?Best solution by Stack Overflow
- How can I convert the query from SQL to LINQ?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.