Solved

viewing specific date of data?

Posted on 2012-03-10
4
216 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
  • 3
4 Comments
 
LVL 49

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 49

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 49

Expert Comment

by:Gustav Brock
ID: 37706227
You are welcome!

/gustav
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

18 Experts available now in Live!

Get 1:1 Help Now