locked
how to get value from another table where it is a secondary key RRS feed

  • Question

  • I'm trying to make it through query.

    The code below does not have syntax errors. 

    But when I run on the screen an exception:

    The code throws an exception during execution: "Selecting the source element is the only supported selector.  Parameter name: selector."

     int? Scsumm = this.ScoringSum;

                if (Scsumm <= 250)
                {
                    this.SolvencyItem.SolvencyStat = (from sS in this.DataWorkspace.F__ПРОЕКТ_MYSOLVENCYLOAN_MDFData.Solvency
                                                     where sS.ID_Solvency == 3 
                                                     select sS.SolvencyStat).ToString();                                   
                                                  
                }

    Maybe this can be done in another way?

    Friday, May 9, 2014 1:49 PM

Answers

  • Try

    this.SolvencyItem.SolvencyStat
         = (from sS in this.DataWorkspace.F__ПРОЕКТ_MYSOLVENCYLOAN_MDFData.Solvency
            where sS.ID_Solvency == 3
            select sS).FirstOrDefault().SolvencyStat;             
    

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by Angie Xu Tuesday, May 20, 2014 1:10 AM
    • Unmarked as answer by IrinaSahonchik Thursday, October 30, 2014 12:51 PM
    • Marked as answer by IrinaSahonchik Thursday, October 30, 2014 12:51 PM
    Sunday, May 11, 2014 9:24 AM