vendredi 22 avril 2016

Error database is locked sqlite

hi I'm trying to insert a row to my database but I still get this error message (see below):

enter image description here

I used the methode using to be sure that the connection will be closed. below the script for the insert button :

 Private Sub MTB_Insert_Click(sender As Object, e As EventArgs) Handles MTB_Insert.Click
        cmd = New SQLite.SQLiteCommand
        Using con As New SQLite.SQLiteConnection(constr)
                'con.ConnectionString = constr
                cmd.Connection = con
                cmd.CommandText = "Insert Into Material_Type (Material_Type,Material_Type_Description) values(@Type,@Description)"
                cmd.Parameters.AddWithValue("@Type", MTTB_Material_Type.Text)
                cmd.Parameters.AddWithValue("@Description", MTTB_Material_Description.Text)
                MessageBox.Show("Successful Added Data")
                'Calling function load data
            Catch ex As Exception
            End Try
        End Using
    End Sub

can some one help me please ? Thanks in advance

Aucun commentaire:

Enregistrer un commentaire