■98910 / ) |
Re[2]: EFでのUpDate文 |
□投稿者/ Hongliang (1210回)-(2022/01/18(Tue) 12:46:43)
|
Googleより先に > Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. って出てるのだからまずこのEntityValidationErrorsプロパティを確認すべきでは…?
Updateする場合、newしてAddするのではなく、コンテキストから取得したオブジェクトのプロパティを更新するようにします。 var patient = pdbContext.M_Patient.FirstOrDefault(x => x.PatientID == idBox.Text); patient.PatientsName1 = nBox1.Text; ... pdbContext.Update();
// InsertDateまで更新するのはダメじゃないかな…。
|
|