In VB.NET I have a form that stores data into an array while it is loading. The form is a child form. When I click on the toolbar button to open it I keep getting the following error:
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
If I take out the call to the array the child form loads ok. The code for the array is as follows:
i = 0
While Conn.PipeReader.Read
Product(i) = Conn.PipeReader.GetString(0)
i = i + 1
End While
Conn.PipeReader.Close()
The variable product is set at Object.
Could someone please tell me if there is a work around for the memory exception?
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
If I take out the call to the array the child form loads ok. The code for the array is as follows:
i = 0
While Conn.PipeReader.Read
Product(i) = Conn.PipeReader.GetString(0)
i = i + 1
End While
Conn.PipeReader.Close()
The variable product is set at Object.
Could someone please tell me if there is a work around for the memory exception?