UKmedia
Programmer
- Nov 2, 2002
- 90
Code:
Dim strSQL As String
'Update Existing
strSQL = "UPDATE cashier SET FullName = '" & txtName.Text & "', Address = '" & txtAddress.Text & "', Telephone = '" & txtContact.Text & "', Age = '" & txtAge.Text & "', NI = '" & txtNI.Text & "', EContact = '" & txtEContact.Text & "', EName = '" & txtEName.Text & "', ERelationship = '" & txtERelationship.Text & "' WHERE Code=" & "'" & CLng(Me.lvEmployees.SelectedItems(0).Tag) & "'"
Dim ocon As OleDbConnection = New OleDbConnection(DB_Connect)
ocon.Open()
Dim ocmd As OleDbCommand = New OleDbCommand(strSQL, ocon)
ocmd.ExecuteNonQuery()
ocmd.Dispose()
ocon.Close()
MessageBox.Show("Saved Details", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information)
I get error:
Data type mismatch in criteria expression.