Click here to Skip to main content
12,634,101 members (26,097 online)
Rate this:
 
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 3:09am
Updated 6-Jun-11 21:31pm
v2
Comments
asadmehmoodsatti 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 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 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  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 26 Jul 2012
Copyright © CodeProject, 1999-2016
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