Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Sandeep Singh Shekhawat
122
20.1k
27m
How can get Previous item in list using foreach loop?
Apr 26 2013 4:59 AM
I have a list
var _PublicHoliday = _db.tbl_HolidayMasters.Where(x => x.IsDelete == false).ToList();
and i am geting each item using foreach loop
foreach (var objPublicHoliday in _PublicHoliday)
{
if ((Convert.ToDateTime(DateTo.Text).AddDays(1)).Equals(objPublicHoliday.HolidayDate))
{
todate = Convert.ToDateTime(todate).AddDays(1).Date.ToShortDateString();
flagHoliday = 1;
}
}
Whenever I moved next holiday date the how can get previous holiday date in list?
Thanks
Reply
Answers (
2
)
C program with strings
Creating adjacency matrix