我正在使用这样的记录ID(dirID是ID的数组)从sqlite删除数据库: ! K. }# r6 p' R+ D0 O# F. ^6 TDim i As Integer = Dim conn As New SQLiteConnection("Data Source=" & DBPath) Dim cmd As New SQLiteCommand("DELETE FROM directory WHERE id IN (@ID)",conn) cmd.Parameters.AddWithValue("@ID",Join(dirID,",")) conn.SetPassword(dbPassword) conn.Open() Try mytransaction = conn.BeginTransaction() // delete directory /// If dirID IsNot Nothing Then cmd.ExecuteNonQuery() End If mytransaction.Commit() conn.Close() Catch ex As Exception mytransaction.Rollback() strLastError = ex.Message Debug.Print(strLastError) Finally cmd.Dispose() conn.Dispose() End Try问题是它并不总是从数据库中删除,也不会造成任何错误。8 G! |. G8 M! T/ c$ t: _! ?
删除方法会更好吗?5 O2 n0 v* _; ]2 ?) T