Linq query error

2 posts, 0 answers
  1. Iftekhar Ivaan
    Iftekhar Ivaan avatar
    17 posts
    Member since:
    Apr 2006

    Posted 30 Mar 2009 Link to this post

    Why do i get error when I do the following query.


    var tmp = from b in scope.Extent<BusinessRequirement>() where b.Dbid > 0 select b;




    foreach (BusinessRequirement obj in tmp)







    Identifier 'Dbid' is not a parameter, variable or field of 'Paxovision.Galaxy.Entity.BusinessRequirement'. If 'Dbid' is a property please add the FieldAlias attribute to it.
  2. PetarP
    PetarP avatar
    754 posts

    Posted 31 Mar 2009 Link to this post

    Hello Iftekhar Ivaan,
    when you encapsulate your fields with properties you need to add a field allies above the property pointing to the corresponding field. For example if your field name is dbid of type int it should look like this:
            private int dbid; 
            public int Dbid 
                get { return dbid; } 
                set { this.dbid = value; } 

    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft banner
Back to Top