这是我在sqlite数据库中删除的删除功能,所以我看到一个异常数据库被锁定。 这是我的代码:
Dim con As New SQLiteConnection("Data Source= " & AppSettings.DbName & ";Version=3;")
Try
con.Open()
Dim strQuery As String = "DELETE FROM Externalsupplier_Capablity WHERE ID = @id " ' WHERE Vendor_no = @VendorNo"
Dim cmd As SQLiteCommand = New SQLiteCommand(strQuery, con)
cmd.Parameters.Add("@id", DbType.String).Value = TxtdeleteID.Text
System.Diagnostics.Debug.Print(strQuery)
cmd.CommandType = CommandType.Text
cmd.Connection = con
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("An error has occurred: " & ex.Message)
Finally
con.Close()
con.Dispose()
End Try