My UPDATE vb.net code below displays this error message:conversion from string "UPDATE tblstaff SET fName='name' " to type 'integer' is not valid.Microsoft.visualBasic
conn.Open()
If conn.State = ConnectionState.Open Then
com = New OleDb.OleDbCommand("SELECT *FROM tblstaff ")
com.Connection = conn
Dim cb As New OleDb.OleDbCommandBuilder(da)
da.Fill(ds, "Eeestaffinfo")
Dim sql As String = String.Format("UPDATE tblstaff SET fName='{1}', lName='{2}', dob={3}, eMail='{4}', mobileNo='{5}', designation='{6}', address='{7}', fAppointment={8}, fpromotion={9}, lpromotion={10}, publications='{11}', position='{12}', leaveStatus='{13}' WHERE pfNumber='{0}'", txtPfNo.Text, txtFname.Text, txtLname.Text, Format(dtpDob.Value, "dd/MM/yyyy"), txtEmail.Text, txtPno.Text, txtDesignat.Text, txtAddress.Text, Format(dtpFappoint.Value, "dd/MM/yyyy"), Format(dtpFpromo.Value, "dd/MM/yyyy"), Format(dtpLpromo.Value, "dd/MM/yyyy"), txtPublicatn.Text, txtPosition.Text, txtLstatus.Text)
com.CommandType = sql
com.CommandType = CommandType.Text
com.Connection = conn
com.ExecuteNonQuery()
com.Dispose()
'conn.Close()
MessageBox.Show("Good")
End If
Catch ex As Exception
MessageBox.Show(ex.Message & " " & ex.Source)
End Try
conn.Close()