TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sammi taylor
NA
19
0
search a list where id==id with linq C#
Apr 24 2015 1:11 PM
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!
Reply
Answers (
1
)
String Comparison
Is it possible?