A little problem with one column

  • Thread starter Thread starter gwboolean
  • Start date Start date
G

gwboolean

Guest
I am attempting to add a new record to a table and keep getting this error message.

1440434.jpg

Line 209 is the Update()

MasterBaseAdapter.Update(MasterBaseTable)

Quite frankly, I do not understand why this is so. When I step through the adding of a new row, there is a value going into the mentioned column (chrChangeID) as well as other columns. There are several columns that are commented out because I have not decided how I want to put into those yet.


Private Sub SaveNewRecord()
Try
Dim FileDataRow As DataRow = MasterBaseTable.NewRow()
FileDataRow("chrChangeID") = CStr(lblChangeID.Text)
FileDataRow("chrArticleID") = CStr(lblArticle.Text)
FileDataRow("chrTitle") = CStr(txtTitle.Text)
FileDataRow("chrRevision") = CStr(txtRevision.Text)
FileDataRow("chrManager") = CStr(mboEmployee.Text)
'FileDataRow("chrManagerID") = CStr(mboEmployee.Text)
FileDataRow("chrOwner") = CStr(cboOwner.Text)
FileDataRow("chrWhere") = CStr(cboWhere.Text)
'FileDataRow("chrChangeObject") = CStr()
FileDataRow("chrArticleObject") = CStr(_strMasterBase)
'FileDataRow("chrMasterBaseObject") = CStr()
FileDataRow("chrChangeMade") = CStr(txtChanges.Text)
FileDataRow("chrChangeReason") = CStr(txtReason.Text)
FileDataRow("chrChangeResult") = CStr(txtResult.Text)
FileDataRow("chrFilePath") = CStr(_strFilePath)
FileDataRow("dteOpen") = CDate(CStr(txtOpen.Text))
FileDataRow("blnQualify") = CStr(chkQualify.Checked)
MasterBaseTable.Rows.Add(FileDataRow)
Catch ex As Exception
MessageBox.Show("Change Request not saved." + ControlChars.CrLf + ex.Message + ControlChars.CrLf + ex.ToString, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
End Try
End Sub



This particular column is the primary key, but I do not see how that could be a problem. But then there are many things that I do not see.



gwboolean

Continue reading...
 

Similar threads

Back
Top