LINQ statement shows as error

3 posts, 0 answers
  1. Kevin F
    Kevin F avatar
    46 posts
    Member since:
    Sep 2009

    Posted 27 Apr 2010 Link to this post

    I get a "C#: This expression is not a valid statement" with the attached code.  The first error that shows up is "C#: Missing ';'" The red line starts right after the join keyword.

    var leinAssocResults = 
                    from l 
                    in (leinDb.tblLEIN_LEINs) 
                    join lar in (leinDb.tblLEIN_Associates.Where(leinAssocPredicate)) 
                    on l.LEINNUM equals lar.LEINNUM 
                    orderby l.Sort_Num descending 
                    select new 
                    { 
                        lar.LNAME, 
                        lar.FNAME, 
                        lar.LEINNUM, 
                        lar.DOB, 
                        l.DISSEMINAT, 
                        lar.TYPE, 
                        lar.SEX, 
                        lar.RACE 
                    }; 

    Any ideas?

    Thanks!
  2. Kevin F
    Kevin F avatar
    46 posts
    Member since:
    Sep 2009

    Posted 27 Apr 2010 Link to this post

    Found the problem.  JustCode did not like the parens; below works fine.
    var leinAssocResults =  
                    from l  
                    in leinDb.tblLEIN_LEINs 
                    join lar in leinDb.tblLEIN_Associates.Where(leinAssocPredicate) 
                    on l.LEINNUM equals lar.LEINNUM  
                    orderby l.Sort_Num descending  
                    select new  
                    {  
                        lar.LNAME,  
                        lar.FNAME,  
                        lar.LEINNUM,  
                        lar.DOB,  
                        l.DISSEMINAT,  
                        lar.TYPE,  
                        lar.SEX,  
                        lar.RACE  
                    };  

  3. DevCraft banner
  4. Hans Kratz
    Admin
    Hans Kratz avatar
    102 posts

    Posted 28 Apr 2010 Link to this post

    Hello Jason,

    thanks a lot for your feedback. I could reproduce it and scheduled it for fixing in the Q2 release. You will be automatically notified once it is fixed.

    I have awarded you some Telerik points as compensation for your efforts.


    Kind regards,
    Hans Kratz
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top