16,006,605 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Joris Janssens (Top 6 by date)
Joris Janssens
19-Sep-11 17:51pm
View
TimeSpan has some convenient static methods to create an instance. TimeSpan.FromMinutes(double value) will eliminate the need for the conversion to ticks.
=> TimeSpan ts = TimeSpan.FromMinutes(120.75);
Joris Janssens
28-Jul-11 5:01am
View
It was code for WinForms not WPF. I edited my solution with an example for WPF.
Joris Janssens
27-Jul-11 16:30pm
View
very weird, I replicated your code and it's working normally here.
1. does "Console.WriteLine(to.ToString("yyyy-MM-dd HH:mm:ss"));" outputs "2011-01-31 23:59:59"
2. does it work normally when you replace "q = q.Where(n => n.Date <= to);" with the following code:
List<datetime> oldDates = new List<datetime>();
foreach (DateTime n in q) {
if (n.Date <= to) {
oldDates.Add(n);
}
}
foreach (var qq in oldDates) {
//output
}
This also has the benefit that you can step through it to see where it goes horribly wrong. But again, I see now flaw in your code.
Joris Janssens
27-Jul-11 15:18pm
View
You shouldn't get items from feb 2011 or later with that code. One question though: are the february items you get from 2011 (which shouldn't happen) or from earlier years (totally normal)?
Joris Janssens
27-Jul-11 15:12pm
View
"Even if you substract 1 Millisecond, it still remains 01-Fab-2011. "
That's not correct. If you subtract one millisecond you end up with 2011-Jan-31 23:59:59. I would have used "DateTime to = new DateTime(2011, 2,1)" as end date and "n.Date < to" though, it's a bit cleaner.
Joris Janssens
21-Jul-11 17:34pm
View
With AJAX it is possible to use client side validation. Create a generic handler that makes the database calls and writes the results to the outputstream and put in the client side method a synchronous(!) AJAX call to that handler.
Show More