Click here to Skip to main content
11,576,293 members (54,688 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: LINQ
Hi,
How can convert the following sql sring to LINQ :
OracleSqlString= "SELECT * FROM AA,BB,CC " & _
                 "WHERE AA.L_ID=BB.L_ID(+) " & _
                 "AND AA.PARENT_ID=" & PARAM & _
                 " AND AA.LEVEL_ID=CC.LEVEL_ID"
please help me...
Posted 25-May-10 2:09am
Edited 6-Jun-11 20:31pm
v2
Comments
asadmehmoodsatti at 7-Jan-13 6:48am
   
how to convert into linq

select count(whe.Availability), whe.warehouse_id from Warehouse_Equipment as whe
join [Inventory.Equipment.item] as ieitm
on whe.item_id= ieitm.id
join [Inventory.PO.PurchaseOrderDetail] as pod
on ieitm.id=pod.item_id
where whe.Availability=1
group by whe.Availability, whe.warehouse_id
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

Can you try this -

var OracleLinqString = from AA in Label_ID, PARENT_ID, LEVEL_ID
     join BB in L_ID
       on AA.L_ID equals BB.L_ID
     join CC in LEVEL_ID
       on AA.LEVEL_ID equals CC.LEVEL_ID
           WHERE AA.PARENT_ID == <Your_Variable>
     select AA;


Rregards,

Nilesh Shah
  Permalink  
Comments
abduh123 at 25-May-10 9:59am
   
Thank you Nilesh Shah
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Check out LinqPad[^]. This great and free tool lets you work directly with your database using LINQ, SQL, ESQL and see the equivalent SQL for your LINQ or Lambda expressions.
  Permalink  
v2
Comments
abduh123 at 25-May-10 10:00am
   
Thank you Matthew
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Select Distinct A.SANCTION_ORDER_NO,A.SANCTION_ORDER_DATE,
D.FORCE_NO
From FM_TB_HOSTEL_SUBSIDY_SANCTION_HDR_T A join
FM_TB_HOSTEL_SUBSIDY_SANCTION_APPDTL_T B on A.SANCTION_ORDER_NO =B.SANCTION_ORDER_NO
join FM_TB_HOSTEL_SUBSIDY_SANCTION_DTL_T C on C.EMP_SEQ_NO =B.EMP_SEQ_NO And C.SANCTION_ORDER_NO =B.SANCTION_ORDER_NO
Join PM_TB_APP_APPOINTMENT_T D On D.EMP_SEQ_NO =B.EMP_SEQ_NO
Join PM_TB_MST_RANK_M E On D.PRESENT_RANK_CODE =E.RANK_CODE
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Select Distinct A.SANCTION_ORDER_NO,A.SANCTION_ORDER_DATE,
D.FORCE_NO
From FM_TB_HOSTEL_SUBSIDY_SANCTION_HDR_T A join
FM_TB_HOSTEL_SUBSIDY_SANCTION_APPDTL_T B on A.SANCTION_ORDER_NO =B.SANCTION_ORDER_NO
join FM_TB_HOSTEL_SUBSIDY_SANCTION_DTL_T C on C.EMP_SEQ_NO =B.EMP_SEQ_NO And C.SANCTION_ORDER_NO =B.SANCTION_ORDER_NO
Join PM_TB_APP_APPOINTMENT_T D On D.EMP_SEQ_NO =B.EMP_SEQ_NO
Join PM_TB_MST_RANK_M E On D.PRESENT_RANK_CODE =E.RANK_CODE
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

select C.OrganizationID from aspnetdb.dbo.aspnet_Users A INNER JOIN aspnetdb.dbo.aspnet_Profile B
on A.UserId = B.UserId INNER JOIN sos.dbo.OrganizationInformation C ON
substring(B.PropertyValuesString,1,datalength(B.PropertyValuesString)) = C.OrganizationID
where A.UserName = @UserName and B.PropertyNames like 'MartSOSOrgId%'
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

var query = from p in dc1.aspnet_Users
join p1 in dc1.aspnet_Profiles on p.UserId equals p1.UserId
join p2 in dc.OrganizationInformations on
p1.PropertyValuesString.Substring(1,p1.PropertyValuesString.Length) equals p2.organizationID
where (p.UserName == userName) && (p1.PropertyNames.Contains("MartSOSOrgId"))
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

select C.OrganizationID from aspnetdb.dbo.aspnet_Users A INNER JOIN aspnetdb.dbo.aspnet_Profile B
on A.UserId = B.UserId INNER JOIN sos.dbo.OrganizationInformation C ON
substring(B.PropertyValuesString,1,datalength(B.PropertyValuesString)) = C.OrganizationID
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

SELECT * FROM tecoGrupoCliente GC WHERE GC.id_grupo IN
(SELECT CL.id_grupo FROM vsgaEmpresa_ObterLista CL)
  Permalink  
Comments
Wes Aday at 26-Jul-12 10:50am
   
What does this have to do with this 2 year old quesiton?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 285
1 F-ES Sitecore 140
2 Abhinav S 115
3 Lucifier Rocks 105
4 OriginalGriff 105
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 630
2 Abhinav S 438
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 26 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100