my database table creation works. now i have added a form with a progress bar when this is going through and now get an error when trying to close the form after the sql file has been successfully deleted.
------------------------------Start Of Error------------------------------
Error Occurred On:
5/3/2008 12:31:40 PM

Data:
System.Collections.ListDictionaryInternal

Message:
Value Close() cannot be called while doing CreateHandle().

Stack Trace:
at System.Windows.Forms.Form.Close()
at BusinessStudio.frmSQLExecuteProgress.frmSQLExecuteProgress_Load(Object sender, EventArgs e) in D:\BusinessStudio\frmSQLExecuteProgress.vb:line 36
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
------------------------------ End Of Error ------------------------------
vb Code:
  1. Public Class frmSQLExecuteProgress
  2.     Private Sub frmSQLExecuteProgress_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3.         'form layout
  4.         FormLayout(Me)
  5.  
  6.         'specify the location of the dbu file
  7.         Dim strFileLocation As String = My.Application.Info.DirectoryPath & "\sql\sql.dbu"
  8.  
  9.         With (My.Computer.FileSystem)
  10.             'lets see if the file exists
  11.             If System.IO.File.Exists(strFileLocation) Then
  12.                 'read all the lines in the file
  13.                 Dim arrDBULineCount() As String = IO.File.ReadAllLines(strFileLocation)
  14.  
  15.                 With prgDatabaseExecution
  16.                     'set the minimum to 0%
  17.                     .Minimum = 0
  18.                     'set the maximum to 100%
  19.                     .Maximum = 100
  20.                     'give step the value of the number of lines in the dbu file
  21.                     .Step = CInt(arrDBULineCount.Length.ToString)
  22.                     'get the incremental by dividing the line count by 100
  23.                     .Value = CInt(.Step / .Maximum)
  24.                     'start the progress bar
  25.                     .PerformStep()
  26.  
  27.                     If .Value = 100 Then
  28.                         'now that the request has been completed, delete the file
  29.                         IO.File.Delete(strFileLocation)
  30.                         'close this screen
  31.                     End If
  32.                 End With
  33.             End If
  34.         End With
  35.  
  36.         Me.Close()
  37.     End Sub
  38. End Class
been working at this for a few hours and not sure what to do