linq to sql outer left join with multiple join conditions
I have a two table that I need to join and select values from, the join needs to be left outer join. I am trying to use linq to sql but getting 0 instead of real values

**references table:**

    refType varchar(250),
    description varchar(250)

**presentationsType (another table of mine)**

    id int
    refType varchar(250),
    OtherFundings varchar(250)

The query I am using is

    string organization = (string)Session["organization"];
    int FiscalYear = Int32.Parse((string)Session["fiscalyear"]);
    string ReportingPeriod = (string)Session["reportingperiod"];
    
    var presentationType = from pt in OCHART.References
                           join rf in OCHART.OCHART_PresentationTypes on pt.RefType equals rf.RefType into prt                                       
                           from x in prt.Where(prt2 => prt2.OrganizationName.Equals(organization) && prt2.ReportingPeriod.Equals(ReportingPeriod) && prt2.FiscalYear == FiscalYear).DefaultIfEmpty()
                            where pt.RefType.Equals("09-10.1b")                                          
                            orderby pt.RefOrder ascending
                            select new {
                                  refType = pt.RefType, 
                                  refName = pt.Description,
                                  otherFundings = (x.Fundings == null ? 0 : x.Fundings), 
                                  id = (x.id == null ? 0 : x.id)
                             };


But I am getting id = 0 and otherFunding = 0 despite having proper values in the second table. I am really unsure of what I am doing wrong.

Would appreciate a help.

Thanks.

linq to sql outer left join with multiple join conditions
===

I have a two table that I need to join and select values from, the join needs to be left outer join. I am trying to use linq to sql but getting 0 instead of real values

**references table:**

    refType varchar(250),
    description varchar(250)

**presentationsType (another table of mine)**

    id int
    refType varchar(250),
    OtherFundings varchar(250)

The query I am using is

    string organization = (string)Session["organization"];
    int FiscalYear = Int32.Parse((string)Session["fiscalyear"]);
    string ReportingPeriod = (string)Session["reportingperiod"];
    
    var presentationType = from pt in OCHART.References
                           join rf in OCHART.OCHART_PresentationTypes on pt.RefType equals rf.RefType into prt                                       
                           from x in prt.Where(prt2 => prt2.OrganizationName.Equals(organization) && prt2.ReportingPeriod.Equals(ReportingPeriod) && prt2.FiscalYear == FiscalYear).DefaultIfEmpty()
                            where pt.RefType.Equals("09-10.1b")                                          
                            orderby pt.RefOrder ascending
                            select new {
                                  refType = pt.RefType, 
                                  refName = pt.Description,
                                  otherFundings = (x.Fundings == null ? 0 : x.Fundings), 
                                  id = (x.id == null ? 0 : x.id)
                             };


But I am getting id = 0 and otherFunding = 0 despite having proper values in the second table. I am really unsure of what I am doing wrong.

Would appreciate a help.

Thanks.
