我一直在尝试在DataGridView中进行更新,并且不断返回此
没有给出一个或多个必需参数的值
这是我的代码
private final Map <String, Parent> fxmls = new HashMap<>();
@FXML
public void handleChangeView(ActionEvent event) {
try {
String changeButtonID = ((Button) event.getSource()).getId();
Parent newOne = fxmls.get(changeButtonID);
if (newOne == null) {
FXMLLoader loader = new FXMLLoader(getClass().getResource("../../resources/view/" + changeButtonID + ".fxml"));
newOne = loader.load();
fxmls.put(changeButtonID, newOne):
}
mainView.setCenter(newOne);
} catch (IOException e){
e.printStackTrace();
}
}
答案 0 :(得分:0)
您需要在字段名称上添加括号,因为某些字段名称可能是Access上的关键字。更改您的查询如下:
String comando = "UPDATE [Funcionario] SET [Nome]= '" + txtNome.Text + "' , [Login]= '" + txtLogin.Text + "' , [Senha]= '" + txtSenha.Text + "', [Email]= '" + txtEmail.Text + "' , [Cargo]= '" + txtCargo.Text + "' WHERE [Codigo] =" + codigo;