Solved

viewing specific date of data?

Posted on 2012-03-10
4
220 Views
Last Modified: 2012-03-10
How to set the code viewing specific date?

        public IQueryable<SalesRecord> GetSalesRecordDatimeId(int branchid, DateTime Sdate, DateTime Edate)
        {
            return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid && so.TheDate == Sdate);
        }
I need to view the Data from Sdate to Edate... my xaml are as follows;

        private void button2_Click(object sender,  RoutedEventArgs e)
        {
            int BrId = int.Parse(this.txtme.Text);
            DateTime Mydate = DateTime.Parse(this.datePicker1.Text);
            DateTime xdate = DateTime.Parse(this.datePicker2.Text);
            if (_Context.EntityContainer != null) _Context.EntityContainer.GetEntitySet<SalesRecord>().Clear();
            _Context.Load(_Context.GetSalesRecordDatimeIdQuery(BrId, Mydate, xdate));
        }
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
  • 3
4 Comments
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 37704940
You could modify to:

 return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid && so.TheDate >= Sdate && so.TheDate <= Edate);

/gustav
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 37704953
And I think you have a typo here:

_Context.Load(_Context.GetSalesRecordDatimeId(BrId, Mydate, xdate));

/gustav
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 37705404
Thanks a lot... Perfect!
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 37706227
You are welcome!

/gustav
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Gridview 1 66
linq .concat equivalent with expression syntax 4 26
global Variable - 2 functions in powershell 1 22
orderby list (from Json) 1 32
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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

696 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