Linq Where Error

2 posts, 0 answers
  1. ehsan sadeghi
    ehsan sadeghi avatar
    11 posts
    Member since:
    May 2005

    Posted 24 May 2011 Link to this post

    I have this code :



    var query = hedSearch.OperationalSubBranches;

    query = query.Where(x=> x.RefIdOperationBranch == Convert.ToInt32(radcmbOperationalBranch.SelectedValue));

    radcmbOperationalSubBranch.DataSource = query.ToList();

    radcmbOperationalSubBranch.DataTextField = 




    radcmbOperationalSubBranch.DataValueField = 






    But an error raise for where clause. How can i fix it?
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 25 May 2011 Link to this post

    Hi ehsan sadeghi,

    Could you please share with us more details regarding the error that appears on your side?
    Please try to modify the query in the following way:

    int refId = Convert.ToInt32(radcmbOperationalBranch.SelectedValue);
    query = query.Where(x => x.RefIdOperationBranch == refId);

    We are looking forward to hearing from you.

    All the best,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  3. DevCraft banner
Back to Top