This is a migrated thread and some comments may be shown as answers.

Linq Where Error

1 Answer 23 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ehsan sadeghi
Top achievements
Rank 1
ehsan sadeghi asked on 24 May 2011, 05:48 AM
I have this code :

 

 

var query = hedSearch.OperationalSubBranches;

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

radcmbOperationalSubBranch.DataSource = query.ToList();

radcmbOperationalSubBranch.DataTextField = 

 

"Name";

 

radcmbOperationalSubBranch.DataValueField = 

 

"Id";

 

radcmbOperationalSubBranch.DataBind();

 


But an error raise for where clause. How can i fix it?

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 25 May 2011, 05:33 PM
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.
Tags
LINQ (LINQ specific questions)
Asked by
ehsan sadeghi
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or