错误:数据库锁定

时间:2017-08-08 09:01:37

标签: visual-studio-2010 sqlite

这是我在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

0 个答案:

没有答案