I'm stuck in here
My goal is to iterate through date
and compare it to string from a line read from a txt file
Here is my code
Code:
private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
        {
            if (StartingDate > EndingDate)
            {
                return null;
            }
            List<DateTime> rv = new List<DateTime>();
            DateTime tmpDate = StartingDate;
            do
            {
                rv.Add(tmpDate);
                tmpDate = tmpDate.AddDays(1);
            } while (tmpDate <= EndingDate);
            return rv;
        }


        private void button3_Click(object sender, EventArgs e)
        {
            StreamReader strReader = new StreamReader(Application.StartupPath + "\\Logs\\Sample Logs.txt");
            string [] strArray = new string[3];
            string sLine = "";
            foreach (DateTime date in GetDateRange(dtpStart .Value,dtpEnd.Value))
            {
                //lb.Items.Add(string.Format ("{0:yyyy/MM/dd}",date.Date));
                while (strReader.EndOfStream == false)
                {
                    sLine = strReader.ReadLine();
                    strArray = sLine.Split(',');

                    if (strArray[1] == string.Format("{0:yyyy/MM/dd}", date.Date))
                    {
                        lb.Items.Add(strArray[1] + "*" + strArray[2]);
                    }

                }
                
            }
        }
It seems that my loop to iterate days on dates is stuck at first day only.
It just execute then read a file, after a file, going to next day is stop.

Here is the content of my txtfile

Code:
1,2011/12/1,7:31,0
2,2011/12/1,7:32,0
3,2011/12/1,7:33,0
4,2011/12/1,7:34,0
1,2011/12/1,11:50,0
2,2011/12/1,11:51,0
3,2011/12/1,11:52,0
4,2011/12/1,11:53,0
1,2011/12/1,13:01,0
2,2011/12/1,13:02,0
3,2011/12/1,13:03,0
4,2011/12/1,13:04,0
1,2011/12/1,17:31,0
2,2011/12/1,17:32,0
3,2011/12/1,17:33,0
4,2011/12/1,17:34,0
1,2011/12/2,7:31,0
2,2011/12/2,7:32,0
3,2011/12/2,7:33,0
4,2011/12/2,7:34,0
1,2011/12/2,11:50,0
2,2011/12/2,11:51,0
3,2011/12/2,11:52,0
4,2011/12/2,11:53,0
1,2011/12/2,13:01,0
2,2011/12/2,13:02,0
3,2011/12/2,13:03,0
4,2011/12/2,13:04,0
1,2011/12/2,17:31,0
2,2011/12/2,17:32,0
3,2011/12/2,17:33,0
4,2011/12/2,17:34,0
1,2011/12/3,7:31,0
2,2011/12/3,7:32,0
3,2011/12/3,7:33,0
4,2011/12/3,7:34,0
1,2011/12/3,11:50,0
2,2011/12/3,11:51,0
3,2011/12/3,11:52,0
4,2011/12/3,11:53,0
1,2011/12/3,13:01,0
2,2011/12/3,13:02,0
3,2011/12/3,13:03,0
4,2011/12/3,13:04,0
1,2011/12/3,17:31,0
2,2011/12/3,17:32,0
3,2011/12/3,17:33,0
4,2011/12/3,17:34,0
1,2011/12/4,7:31,0
2,2011/12/4,7:32,0
3,2011/12/4,7:33,0
4,2011/12/4,7:34,0
1,2011/12/4,11:50,0
2,2011/12/4,11:51,0
3,2011/12/4,11:52,0
4,2011/12/4,11:53,0
1,2011/12/4,13:01,0
2,2011/12/4,13:02,0
3,2011/12/4,13:03,0
4,2011/12/4,13:04,0
1,2011/12/4,17:31,0
2,2011/12/4,17:32,0
3,2011/12/4,17:33,0
4,2011/12/4,17:34,0
1,2011/12/5,7:31,0
2,2011/12/5,7:32,0
3,2011/12/5,7:33,0
4,2011/12/5,7:34,0
1,2011/12/5,11:50,0
2,2011/12/5,11:51,0
3,2011/12/5,11:52,0
4,2011/12/5,11:53,0
1,2011/12/5,13:01,0
2,2011/12/5,13:02,0
3,2011/12/5,13:03,0
4,2011/12/5,13:04,0
1,2011/12/5,17:31,0
2,2011/12/5,17:32,0
3,2011/12/5,17:33,0
4,2011/12/5,17:34,0
1,2011/12/6,7:31,0
2,2011/12/6,7:32,0
3,2011/12/6,7:33,0
4,2011/12/6,7:34,0
1,2011/12/6,11:50,0
2,2011/12/6,11:51,0
3,2011/12/6,11:52,0
4,2011/12/6,11:53,0
1,2011/12/6,13:01,0
2,2011/12/6,13:02,0
3,2011/12/6,13:03,0
4,2011/12/6,13:04,0
1,2011/12/6,17:31,0
2,2011/12/6,17:32,0
3,2011/12/6,17:33,0
4,2011/12/6,17:34,0
1,2011/12/7,7:31,0
2,2011/12/7,7:32,0
3,2011/12/7,7:33,0
4,2011/12/7,7:34,0
1,2011/12/7,11:50,0
2,2011/12/7,11:51,0
3,2011/12/7,11:52,0
4,2011/12/7,11:53,0
1,2011/12/7,13:01,0
2,2011/12/7,13:02,0
3,2011/12/7,13:03,0
4,2011/12/7,13:04,0
1,2011/12/7,17:31,0
2,2011/12/7,17:32,0
3,2011/12/7,17:33,0
4,2011/12/7,17:34,0
1,2011/12/8,7:31,0
2,2011/12/8,7:32,0
3,2011/12/8,7:33,0
4,2011/12/8,7:34,0
1,2011/12/8,11:50,0
2,2011/12/8,11:51,0
3,2011/12/8,11:52,0
4,2011/12/8,11:53,0
1,2011/12/8,13:01,0
2,2011/12/8,13:02,0
3,2011/12/8,13:03,0
4,2011/12/8,13:04,0
1,2011/12/8,17:31,0
2,2011/12/8,17:32,0
3,2011/12/8,17:33,0
4,2011/12/8,17:34,0
1,2011/12/9,7:31,0
2,2011/12/9,7:32,0
3,2011/12/9,7:33,0
4,2011/12/9,7:34,0
1,2011/12/9,11:50,0
2,2011/12/9,11:51,0
3,2011/12/9,11:52,0
4,2011/12/9,11:53,0
1,2011/12/9,13:01,0
2,2011/12/9,13:02,0
3,2011/12/9,13:03,0
4,2011/12/9,13:04,0
1,2011/12/9,17:31,0
2,2011/12/9,17:32,0
3,2011/12/9,17:33,0
4,2011/12/9,17:34,0
1,2011/12/10,7:31,0
2,2011/12/10,7:32,0
3,2011/12/10,7:33,0
4,2011/12/10,7:34,0
1,2011/12/10,11:50,0
2,2011/12/10,11:51,0
3,2011/12/10,11:52,0
4,2011/12/10,11:53,0
1,2011/12/10,13:01,0
2,2011/12/10,13:02,0
3,2011/12/10,13:03,0
4,2011/12/10,13:04,0
1,2011/12/10,17:31,0
2,2011/12/10,17:32,0
3,2011/12/10,17:33,0
4,2011/12/10,17:34,0
1,2011/12/11,7:31,0
2,2011/12/11,7:32,0
3,2011/12/11,7:33,0
4,2011/12/11,7:34,0
1,2011/12/11,11:50,0
2,2011/12/11,11:51,0
3,2011/12/11,11:52,0
4,2011/12/11,11:53,0
1,2011/12/11,13:01,0
2,2011/12/11,13:02,0
3,2011/12/11,13:03,0
4,2011/12/11,13:04,0
1,2011/12/11,17:31,0
2,2011/12/11,17:32,0
3,2011/12/11,17:33,0
4,2011/12/11,17:34,0
1,2011/12/12,7:31,0
2,2011/12/12,7:32,0
3,2011/12/12,7:33,0
4,2011/12/12,7:34,0
1,2011/12/12,11:50,0
2,2011/12/12,11:51,0
3,2011/12/12,11:52,0
4,2011/12/12,11:53,0
1,2011/12/12,13:01,0
2,2011/12/12,13:02,0
3,2011/12/12,13:03,0
4,2011/12/12,13:04,0
1,2011/12/12,17:31,0
2,2011/12/12,17:32,0
3,2011/12/12,17:33,0
4,2011/12/12,17:34,0
1,2011/12/13,7:31,0
2,2011/12/13,7:32,0
3,2011/12/13,7:33,0
4,2011/12/13,7:34,0
1,2011/12/13,11:50,0
2,2011/12/13,11:51,0
3,2011/12/13,11:52,0
4,2011/12/13,11:53,0
1,2011/12/13,13:01,0
2,2011/12/13,13:02,0
3,2011/12/13,13:03,0
4,2011/12/13,13:04,0
1,2011/12/13,17:31,0
2,2011/12/13,17:32,0
3,2011/12/13,17:33,0
4,2011/12/13,17:34,0
1,2011/12/14,7:31,0
2,2011/12/14,7:32,0
3,2011/12/14,7:33,0
4,2011/12/14,7:34,0
1,2011/12/14,11:50,0
2,2011/12/14,11:51,0
3,2011/12/14,11:52,0
4,2011/12/14,11:53,0
1,2011/12/14,13:01,0
2,2011/12/14,13:02,0
3,2011/12/14,13:03,0
4,2011/12/14,13:04,0
1,2011/12/14,17:31,0
2,2011/12/14,17:32,0
3,2011/12/14,17:33,0
4,2011/12/14,17:34,0
1,2011/12/15,7:31,0
2,2011/12/15,7:32,0
3,2011/12/15,7:33,0
4,2011/12/15,7:34,0
1,2011/12/15,11:50,0
2,2011/12/15,11:51,0
3,2011/12/15,11:52,0
4,2011/12/15,11:53,0
1,2011/12/15,13:01,0
2,2011/12/15,13:02,0
3,2011/12/15,13:03,0
4,2011/12/15,13:04,0
1,2011/12/15,17:31,0
2,2011/12/15,17:32,0
3,2011/12/15,17:33,0
4,2011/12/15,17:34,0
That is an attendace records.
My plan is to save that data to database before I manage it.
I need to search and record all in and out for a given date.

Thanks