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
David Smith
NA
2k
0
C# Combine Linq
Apr 20 2015 9:48 AM
//Getting the parentid that is listed multiple times in the grandparent table.
var parentCount = (from c in GetGrandparentChildRows(grandparentRow).AsEnumerable()
where Convert.ToInt32(c["ParentId"]) == parent.ParentId
select c).Count();
//If the parent id count is greater than one, then there are multiple parent ids of the same number parent or number, which is valid
if(parentCount > 1)
{
Choose the lowest/min grandparent id integer or record with the of same parent id
var lowestGrandparentIdRecord = (from c in GetGrandparentChildRows(grandparentRow).AsEnumerable()
where Convert.ToInt32(c["ParentId"]) == parent.ParentId
select c).Min(s => s["GrandparentId"]);
Select Grandparent Name, Address, and GrandparentID
var grandparentRecord = from c in GetGrandparentChildRows(grandparentRow).AsEnumerable()
where Convert.ToInt32(c["GrandparentId"]) == Convert.ToInt32(lowestGrandparentIdRecord)
select c;
}
Reply
Answers (
0
)
login with facebook and linkedIn in one page c# ?
RouteCollection.ignore doesn't work