I am very new to VB.Net and have been developing an application using SQLite. Suddenly today I am getting the "LogBook Update failed - Concurrency violation: the UpdateCommand affected 0 of the expected 1 records" with this single user application.

The form in question allows updates and deletes only and the error occurs when you make an update.

Code:
Public Class LogEditor
    ' Create Data Set object
    Dim naqlogDb As String = My.Settings.DBname
    Dim connectionString As String = My.Settings.DBstring
    Dim da As New SQLiteDataAdapter
    Dim dt As New DataTable
    Dim SQLite_Command As SQLite.SQLiteCommand
    Dim BandList As New List(Of String)()

    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.TopMost = True
        Load_Tooltips()
        'Load Band list
        BandList.Add("160m")
        BandList.Add("80m") ' reduced set for testing
    
        DataGridLoad()
        DataGridFormatting()

    End Sub

    Private Sub DataGridLoad()
        connectionString = String.Format(connectionString, naqlogDb)
        Dim sql As String = "Select rowid, QSO_Callsign, QSO_Band, QSO_Frequency, QSO_Date, QSO_Time, RST_TX, RST_RX, QSO_Mode, QSO_Locator, QSO_ContactName, QSO_Location, QSO_Notes FROM LogBook"
        'Dim sql As String = "Select rowid, QSO_Callsign, QSO_Band, QSO_Frequency, QSO_Date, QSO_Time, RST_TX, RST_RX, QSO_Mode, QSO_Locator, QSO_ContactName, QSO_Location, QSO_Notes FROM LogBook ORDER BY 1 DESC"
        Try
            Dim con As New SQLiteConnection(connectionString)
            con.Open()
            SQLite_Command = New SQLiteCommand(sql, con)
            da.SelectCommand = SQLite_Command
            da.Fill(dt)
            LogDataGridView.DataSource = dt
            con.Close()
        Catch ex As Exception
            MessageBox.Show("LogBook Fill Datagrid failed - " & ex.Message)
        End Try
    End Sub

    Private Sub DataGridFormatting()
        'Cosmetic Formatting
       'removed to shorten code pasted
    End Sub

    Private Sub SQL_Update_LogBook()
        Dim SQLite_CommandBuilder As New SQLite.SQLiteCommandBuilder
        Try
            Using con As New SQLiteConnection(connectionString)
                con.Open()
                SQLite_CommandBuilder = New SQLiteCommandBuilder(da)
                da.Update(dt)
                con.Close()
            End Using
        Catch ex As Exception
            MessageBox.Show("LogBook Update failed - " & ex.Message)
        End Try
    End Sub

    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles BtnExit.Click
        Me.Close()
    End Sub

    Private Sub LogDataGridView_EditingControlShowing(sender As System.Object, e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles LogDataGridView.EditingControlShowing
        'Convert specific fields to upper case
        If LogDataGridView.CurrentCell.OwningColumn.HeaderText = "Callsign" Or
            LogDataGridView.CurrentCell.OwningColumn.HeaderText = "Mode" Or
            LogDataGridView.CurrentCell.OwningColumn.HeaderText = "Locator" Then
            CType(e.Control, TextBox).CharacterCasing = CharacterCasing.Upper
        End If
    End Sub

    Private Sub LogDataGridView_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles LogDataGridView.CellValidating

        If (e.ColumnIndex = 1) Then   ' Checking QSO_Callsign non-blank
            If LogDataGridView.Item(e.ColumnIndex, e.RowIndex).IsInEditMode Then
                If e.FormattedValue = "" Then
                    Dim c As Control = LogDataGridView.EditingControl
                    MessageBox.Show("Please enter a Callsign.")
                    e.Cancel = True
                    LogDataGridView.CancelEdit()
                    Exit Sub
                End If
            End If
        End If

        If (e.ColumnIndex = 2) Then   ' Checking numeric & valid Freq
            If LogDataGridView.Item(e.ColumnIndex, e.RowIndex).IsInEditMode Then
                If BandList.Contains(e.FormattedValue) Then
                    'Valid band provided
                Else
                    Dim c As Control = LogDataGridView.EditingControl
                    MessageBox.Show("Band must be 160m,80m,60m,40m,30m,20m,17m,15m,12m,10m,6m,4m,2m or 70cm")
                    e.Cancel = True
                    LogDataGridView.CancelEdit()
                    Exit Sub
                End If
            End If
        End If

        If (e.ColumnIndex = 6) Then   ' Checking numeric value for RSTTX only
            If LogDataGridView.Item(e.ColumnIndex, e.RowIndex).IsInEditMode Then
                If Not (IsNumeric(e.FormattedValue.ToString) AndAlso CInt(e.FormattedValue.ToString) = e.FormattedValue.ToString) Then
                    Dim c As Control = LogDataGridView.EditingControl
                    MessageBox.Show("RST TX must be numeric")
                    e.Cancel = True
                    LogDataGridView.CancelEdit()
                    Exit Sub
                Else
                    If e.FormattedValue > 21 And e.FormattedValue < 600 Then ' Checking a valid RST
                        'do nothing
                    Else
                        Dim c As Control = LogDataGridView.EditingControl
                        MessageBox.Show("RST TX is not valid")
                        e.Cancel = True
                        LogDataGridView.CancelEdit()
                        Exit Sub
                    End If
                End If
            End If
        End If

        If (e.ColumnIndex = 7) Then   ' Checking numeric value for RSTRX only
            If LogDataGridView.Item(e.ColumnIndex, e.RowIndex).IsInEditMode Then
                If Not (IsNumeric(e.FormattedValue.ToString) AndAlso CInt(e.FormattedValue.ToString) = e.FormattedValue.ToString) Then
                    Dim c As Control = LogDataGridView.EditingControl
                    MessageBox.Show("RST RX must be numeric")
                    e.Cancel = True
                    LogDataGridView.CancelEdit()
                    Exit Sub
                Else
                    If e.FormattedValue > 21 And e.FormattedValue < 600 Then ' Checking a valid RST
                        'do nothing
                    Else
                        Dim c As Control = LogDataGridView.EditingControl
                        MessageBox.Show("RST RX is not valid")
                        e.Cancel = True
                        LogDataGridView.CancelEdit()
                        Exit Sub
                    End If
                End If
            End If
        End If

        If (e.ColumnIndex = 8) Then   ' Checking Mode non-blank & valid Mode
            If LogDataGridView.Item(e.ColumnIndex, e.RowIndex).IsInEditMode Then
                If e.FormattedValue = "AM" Or e.FormattedValue = "CW" Or e.FormattedValue = "FM" Or e.FormattedValue = "LSB" Or e.FormattedValue = "RTTY" Or e.FormattedValue = "USB" Then
                    'do nothing
                Else
                    Dim c As Control = LogDataGridView.EditingControl
                    MessageBox.Show("Please enter a valid Mode - AM, CW, FM, LSB, RTTY or USB.")
                    e.Cancel = True
                    LogDataGridView.CancelEdit()
                    Exit Sub
                End If
            End If
        End If

        SQL_Update_LogBook()

    End Sub

    Private Sub LogDataGridView_UserDeletingRow(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowCancelEventArgs) Handles LogDataGridView.UserDeletingRow
        If Not MessageBox.Show("Are you sure you want delete this entry?", "Deleting Log Entry", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
            e.Cancel = True
        End If
    End Sub
1) If someone could confirm I am access the database correctly ?
2) Am I performing the update in the wrong way?

Thanks in advance for any help