Click here to Skip to main content
15,897,334 members
Home / Discussions / C#
   

C#

 
QuestionHow to implement multi-part FTP Pin
Michael J. Eber6-Feb-12 8:35
Michael J. Eber6-Feb-12 8:35 
AnswerRe: How to implement multi-part FTP Pin
Luc Pattyn6-Feb-12 8:40
sitebuilderLuc Pattyn6-Feb-12 8:40 
GeneralRe: How to implement multi-part FTP Pin
Michael J. Eber6-Feb-12 15:05
Michael J. Eber6-Feb-12 15:05 
AnswerRe: How to implement multi-part FTP Pin
Luc Pattyn6-Feb-12 15:34
sitebuilderLuc Pattyn6-Feb-12 15:34 
AnswerRe: How to implement multi-part FTP Pin
BobJanova6-Feb-12 22:16
BobJanova6-Feb-12 22:16 
Question[Posted in ASP.Net forum] Bug Tracking for ASP.Net Website Pin
Ed Nutting6-Feb-12 2:23
Ed Nutting6-Feb-12 2:23 
AnswerRe: Bug Tracking for ASP.Net Website Pin
Richard MacCutchan6-Feb-12 3:06
mveRichard MacCutchan6-Feb-12 3:06 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Ed Nutting6-Feb-12 3:16
Ed Nutting6-Feb-12 3:16 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Richard MacCutchan6-Feb-12 4:07
mveRichard MacCutchan6-Feb-12 4:07 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Ed Nutting6-Feb-12 5:14
Ed Nutting6-Feb-12 5:14 
AnswerRe: Bug Tracking for ASP.Net Website Pin
Eddy Vluggen6-Feb-12 5:06
professionalEddy Vluggen6-Feb-12 5:06 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Ed Nutting6-Feb-12 5:13
Ed Nutting6-Feb-12 5:13 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Eddy Vluggen6-Feb-12 5:33
professionalEddy Vluggen6-Feb-12 5:33 
GeneralRe: Bug Tracking for ASP.Net Website Pin
Ed Nutting6-Feb-12 5:47
Ed Nutting6-Feb-12 5:47 
AnswerRe: Bug Tracking for ASP.Net Website Pin
Eddy Vluggen6-Feb-12 7:14
professionalEddy Vluggen6-Feb-12 7:14 
Questionwebsite performance Pin
IMQ6-Feb-12 1:15
IMQ6-Feb-12 1:15 
AnswerRe: website performance Pin
J4amieC6-Feb-12 1:51
J4amieC6-Feb-12 1:51 
Calculating the number of dates between two dates, or determining each date between two dates, is such a trivial task that you will almost certainly get worse performance retrieving them from a database. Put another way; A database connection and command execution will be many times slower than counting from startDate to endDate.

For refernce, the two method look like this:

public static double NumberOfDaysInRange(DateTime startDate, DateTime endDate)
{
   return endDate.Subtract(startDate).TotalDays;
}

public static IEnumerable<DateTime> DatesInRange(DateTime startDate, DateTime endDate)
{
    for(var date = startDate; date<endDate; date = date.AddDays(1))
        yield return date;
}


Live example: http://rextester.com/JKDTC31937[^]
GeneralRe: website performance Pin
IMQ6-Feb-12 20:38
IMQ6-Feb-12 20:38 
AnswerRe: website performance Pin
Abhinav S6-Feb-12 2:38
Abhinav S6-Feb-12 2:38 
GeneralRe: website performance Pin
J4amieC6-Feb-12 3:27
J4amieC6-Feb-12 3:27 
AnswerRe: website performance Pin
OriginalGriff6-Feb-12 3:15
mveOriginalGriff6-Feb-12 3:15 
GeneralRe: website performance Pin
IMQ6-Feb-12 20:38
IMQ6-Feb-12 20:38 
GeneralRe: website performance Pin
OriginalGriff6-Feb-12 21:47
mveOriginalGriff6-Feb-12 21:47 
GeneralRe: website performance Pin
OriginalGriff6-Feb-12 22:57
mveOriginalGriff6-Feb-12 22:57 
GeneralRe: website performance Pin
IMQ6-Feb-12 23:28
IMQ6-Feb-12 23:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.