hi,
my module code is like this..
Public cn As New System.Data.SqlClient.SqlConnection()
Public cm As New System.Data.SqlClient.SqlCommand()
Public dr As SqlClient.SqlDataReader
Friend fuser As frmUser
Friend fRoot As frmRoot
Public Sub main()
Dim frmsplash As New frmSplash()
Dim frmRRegister As New frmRootRegister()
Dim frmR As New frmRoot()
frmsplash.Show()
Application.DoEvents()
System.Threading.Thread.Sleep(3000)
frmsplash.Close()
Try
openconnection()
cm.Connection = cn
cm.CommandType = CommandType.Text
cm.CommandText = "Select * from ARootTable"
dr = cm.ExecuteReader
If dr.Read Then
Application.Run(frmR)
Else
Application.Run(frmRRegister)
End If
Catch e As Exception
MsgBox(e.Message)
cn.Close()
cm.Dispose()
dr.Close()
Finally
cn.Close()
cm.Dispose()
dr.Close()
End Try
Exit Sub
End Sub
after application.run(frmR) i am redirecting frmR to new form
but the form is shown for a while then it disappears and coming back to application.run(frmR) then application is closed what can be problem?
my module code is like this..
Public cn As New System.Data.SqlClient.SqlConnection()
Public cm As New System.Data.SqlClient.SqlCommand()
Public dr As SqlClient.SqlDataReader
Friend fuser As frmUser
Friend fRoot As frmRoot
Public Sub main()
Dim frmsplash As New frmSplash()
Dim frmRRegister As New frmRootRegister()
Dim frmR As New frmRoot()
frmsplash.Show()
Application.DoEvents()
System.Threading.Thread.Sleep(3000)
frmsplash.Close()
Try
openconnection()
cm.Connection = cn
cm.CommandType = CommandType.Text
cm.CommandText = "Select * from ARootTable"
dr = cm.ExecuteReader
If dr.Read Then
Application.Run(frmR)
Else
Application.Run(frmRRegister)
End If
Catch e As Exception
MsgBox(e.Message)
cn.Close()
cm.Dispose()
dr.Close()
Finally
cn.Close()
cm.Dispose()
dr.Close()
End Try
Exit Sub
End Sub
after application.run(frmR) i am redirecting frmR to new form
but the form is shown for a while then it disappears and coming back to application.run(frmR) then application is closed what can be problem?