Retrieve a set of DateTime values with intervals
<p>i need to fill a column in a datagridview with time values which has an interval of 30 mins. I have the start time and the timeinterval. I tried hard to use the below coding but it outputs only the start time on each and every cell of the column. could you please help me to retrive the required time values with 30min intervals. Thanks in advance</p>

<pre><code>string line;
System.IO.StreamReader file = new System.IO.StreamReader("test.txt");

        while ((line = file.ReadLine()) != null)
        {
              //Reading the line which contains DISKXFER. Eg:"DISKXFER,T0001,0.5,0.0"
              if (line.Contains("DISKXFER"))
            {
               //split the line and insert to an array, Eg: split[0]=DISKXFER
                string dataLine = line.ToString();
                string[] split = dataLine.Split(',');
                int result = split.Length;

               //get the date at line 12. The date starts from 9th string and has a length of 11.
                string lineDate = GetLine(@"test.txt", 12);
                string getDate=lineDate.Substring(9,11);

                //get the start time at line 11. The timee starts from 9th string and has a length of 8.
                string lineTime = GetLine(@"test.txt", 11);
                string getTime=lineTime.Substring(9,8);

                //merge date and time
                DateTime TestTime = DateTime.Parse(getDate + " " + getTime);                     


                int n = dataGridView1.Rows.Add();
                //split[] has four elements. Add those elements to four columns in the same row and continue with other lines
                for (int i = 0; i &lt; result; i++)
                {
                    //add testtimes to the first column
                    dataGridView1.Rows[n].Cells[0].Value = TestTime;
                    TestTime = TestTime.AddMinutes(30);
                    //add split array to other columns in the same row of testtime. Eg: split[0] to column2, split[1] to column3, split[2] to column4, split[3] to column5
                    dataGridView1.Rows[n].Cells[1].Value = split[i];           

                }                  

            }

        }
        file.Close(); 
</code></pre>

<p>thanks for comments. I will attach the output that i receive and the output that i need
<img src="http://i.stack.imgur.com/zbtMi.png" alt=" A"></p>

<p>the output time values that i need is something like this given that the start time is 12:25 AM
<img src="http://i.stack.imgur.com/NRdtM.png" alt="enter image description here"></p>

<p>Please refer the GetLine method given below:</p>

<pre><code>public string GetLine(string fileName, int line)
    {
        using (System.IO.StreamReader ssr = new System.IO.StreamReader("test.txt"))
        {
            for (int i = 1; i &lt; line; i++)
                ssr.ReadLine();
            return ssr.ReadLine();
        }
    }
</code></pre>
