Link to home
Start Free TrialLog in
Avatar of cdemott33
cdemott33Flag for United States of America

asked on

Help with system.outofmemory error - Do While Loop

I'm sure this is something simple but I just don't see it.  I'm getting a system.outofmemory error when I execute this script.  Can someone have a look at it and tell me what I'm doing incorrectly.  
Dim dt As New DataTable
        dt.Columns.Add("Times", GetType(String))

        Dim startTime As DateTime = "12:00 AM"

        Dim row As DataRow
        row = dt.NewRow()
        row("Times") = startTime
        dt.Rows.Add(row)

        Do While startTime <> "11:30 PM"
            row = dt.NewRow()
            startTime = startTime.AddMinutes(30)
            row("Times") = startTime
            dt.Rows.Add(row)
        Loop

        GridView1.DataSource = dt
        GridView1.DataBind()

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of pateljitu
pateljitu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cdemott33

ASKER

I rebooted the server and it seems to have solved the problem.  Thanks for your help.