Solved

Two conditions in IQueryable

Posted on 2012-03-09
3
269 Views
Last Modified: 2012-03-10
How to correct this two conditions?
        public IQueryable<SalesRecord> GetSalesRecordsBranchId(int branchid, string sDate)
        {
            return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid);
        }
I want to insert sDate something like this... Where so.TheDate == sDate

Please help I don't know how to combine this two conditions...
0
Comment
Question by:Whing Dela Cruz
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
gopaltayde earned 500 total points
ID: 37704345
return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid && so.TheDate == sDate );
0
 

Author Comment

by:Whing Dela Cruz
ID: 37704370
Hi! Thanks a lot.. I've got it.. can I ask 1 more question?
What about if I put another conditions specifying  the range. example I want to view only the date between February 02, 2012 and March 01, 2012

        public IQueryable<SalesRecord> GetSalesRecordsBranchId(int branchid, string sDate, string xDate)
        {
            return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid);
        }
 I want to set sDate and xDate as the range.. Thanks in advance..
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 37704851
Thank you so much..
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now