Following
dtExamDate = DateValue(Now) Sql = "SELECT * FROM surgical_exam_history" adapter = New OleDbDataAdapter(Sql, cn) commandBuilder = New OleDbCommandBuilder(adapter) ds = New DataSet() adapter.Fill(ds, "surgical_exam_history") datarow = ds.Tables("surgical_exam_history").NewRow() datarow("patient_id") = CLng(gszPATIENT_ID) datarow("exam_date") = strExamDate datarow("exam_seq") = nSeqNo datarow("save_datetime") = dtExamDate datarow("edit_datetime") = dtExamDate ' Add to the Rows collection ds.Tables("surgical_exam_history").Rows.Add(datarow) adapter.Update(ds, "surgical_exam_history") =====> Error! ds.Dispose() commandBuilder.Dispose() adapter.Dispose()But error occurs with SQL Server at bold text marked as "======> Error!"
Please refer the screen capture of the error.
FYI, each field's type is like following.
patient_id : bigint
exam_date : datetime
exam_seq : smallint
save_datetime : datetime
edit_datetime : datetime