You must Sign In to post a response.
  • Category: LINQ

    Linquer not understand inner join please tell me

    Hi All,

    please resolve my problem , provide good solutions.

    i am getting error to convert sql to linq using Linquer software.

    my sql query-

    select C.Chkin_No, R.RmNumber from ChkIn C
    inner join RmMaster R on R.RmId=C.RmNoID

    converted linq query-

    from C in db.ChkIns
    join R in db.RmMasters on new { RmId = C.RmNoID } equals new { RmId = (long)R.RmId }
    select new {
    C.Chkin_No,
    R.RmNumber
    }


    Thanks,

    Atul Sharma
  • #750500
    Hello Atul,

    Please correct your query to the one shown below

    from C in db.ChkIns
    join R in db.RmMasters on new { RmId = C.RmNoID } equals new { RmId = (long)R.RmId }
    select new {
    C.Chkin_No,
    R.RmNumber
    }

    from C in db.ChkIns
    join R in db.RmMasters on C.RmNoID equals Convert.ToInt64(R.RmId)
    select new {
    C.Chkin_No,
    R.RmNumber
    }

    Miss. Jain
    Microsoft Certified Technology Specialist in .Net


  • Sign In to post your comments