Solved

Two conditions in IQueryable

Posted on 2012-03-09
3
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
abstract class C# 1 44
Where does legacy ASP.NET initialize language? 2 96
Building an object from several other objects 4 34
How do I "share" on social sites? 2 32
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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