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
Ashok Bhattarai
NA
66
4k
Multiple Where Conditions In Linq
Dec 22 2017 6:30 AM
I want to retrieve the agencyName added between the date ranges arrivalFDate & arrivalTDate . How do I add a linq query having multiple where conditions. ArrivalDate is field of InternationalArrivals.
Like the same way as : SELECT * FROM InternationalArrival where AgentName=@agentName, ArrivalDate IN BETWEEN (@arrivalFDate , @arrivalTDate )
string agentName = result[0];
DateTime arrivalFDate = DateTime.ParseExact(result[1], "dd/MM/yyyy", CultureInfo.InvariantCulture);
DateTime arrivalTDate = DateTime.ParseExact(result[2], "dd/MM/yyyy", CultureInfo.InvariantCulture);
List<InternationalArrival> intarrivals = null;
using (var _context = new SQLHELPSEntities())
{
intarrivals = _context.InternationalArrivals.Where(t => t.AgentName.Contains(agentName)).OrderBy(a => a.AgentName).ToList(); ++++++++++WHERE CONDITION OF DATERANGE FIELD CONTAINS where ArrivalDate In BETWEEN arrivalFDate & arrivalTDate
Reply
Answers (
1
)
how to convert json element to boolean or bool
how to pass textbox value to multiple formaction in view