J
Jan Obrestad
I'm developing an appilcation using CF 1.0 and sqlce 2.0.
Lately I've gotten a strange error: The state of a connection remains
closed after calling Open()
Example:
Private Sub Connect()
'verify database is not blank
If conn Is Nothing Then
conn = New SqlCeConnection(Me.conStrForm)
End If
Try
conn.Open()
'Connection state is closed without throwing an exception.
Catch err As SqlServerCe.SqlCeException
'ErrorDisplay(err, "DBHelper.Connect")
Catch ex As Exception
'ErrorDisplay(ex, "DBHelper.Connect")
End Try
End Sub
This is running in a separate thread, but I'm using SyncLock to make
sure that only one thread writes to the database.
Does anyone have an idea of what is happening?
Jan
Lately I've gotten a strange error: The state of a connection remains
closed after calling Open()
Example:
Private Sub Connect()
'verify database is not blank
If conn Is Nothing Then
conn = New SqlCeConnection(Me.conStrForm)
End If
Try
conn.Open()
'Connection state is closed without throwing an exception.
Catch err As SqlServerCe.SqlCeException
'ErrorDisplay(err, "DBHelper.Connect")
Catch ex As Exception
'ErrorDisplay(ex, "DBHelper.Connect")
End Try
End Sub
This is running in a separate thread, but I'm using SyncLock to make
sure that only one thread writes to the database.
Does anyone have an idea of what is happening?
Jan