G
Guest
My code falls over between line Message 1 & 2 with a SQLCEException.
OrdersDB.sdf exists, OrdersDBTmp.sdf does not.
What seems to be the problem?
Any ideas very welcome.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim srcDB As String = "OrdersDB.sdf"
Dim destDB As String = "OrdersDBTmp.sdf"
Dim engine As New SqlCeEngine("Data Source = " + srcDB)
MessageBox.Show("1")
engine.Compact(("Data Source = " + destDB))
MessageBox.Show("2")
engine.Dispose()
File.Delete(srcDB)
File.Move(destDB, srcDB)
End Sub
OrdersDB.sdf exists, OrdersDBTmp.sdf does not.
What seems to be the problem?
Any ideas very welcome.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim srcDB As String = "OrdersDB.sdf"
Dim destDB As String = "OrdersDBTmp.sdf"
Dim engine As New SqlCeEngine("Data Source = " + srcDB)
MessageBox.Show("1")
engine.Compact(("Data Source = " + destDB))
MessageBox.Show("2")
engine.Dispose()
File.Delete(srcDB)
File.Move(destDB, srcDB)
End Sub