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
diamond diamond
NA
133
55.8k
group a table by a column which has select distinct on colmn
Sep 6 2013 2:30 AM
Hi ,
I have a table with some fields, it is not easy to describe my issue but, I want to group table by a src field which is have select distinct on dst field.
Table name is F has src, name, dst, time fields.
I want my query by linq is resulted as below:
src dst src dst
1 a
1 c 1 a,c
1 a ====>> 2 b
2 b 3 c
3 c
I want for every src the dst are put in list.
this code gives an error.
List<string> srcaddress = (from DataRow dr in dt.Rows group dr by dr["dst"].ToString() Select new dr["src"]).ToList();
Reply
Answers (
7
)
How to get Multiple values in controler from MultiSelect Dro
how to write like operation of sql use in C# by linq