Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
search a list where id==id with linq C#
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
sammi taylor
9y
400
1
Reply
I am not sure how to do this. I want to do a search of a my SearchList where if records exists, give me back anything that has an Id. Not using firstorDefault, or singleorDefault. I would like to use .Any or Contains...but I don't know how.
List
<
SearchBL
> list =
new
List
<
SearchBL
>();
DataTable
dt;
Foreach (DataRow dr in dt.Rows)
{
SearchBL result = from item in list where
where
item.ID == dr.Field<
int
>(
"ID"
) select item....
My datagridview populates with existing data if I filter my search with FirstorDefault. But it turns out I don't need that. Or
Any help is appreciated. Thanks!
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
String Comparison
Is it possible?