Editing Record
I wanted to edit only ta fielda in a row which accepts duplicate values. When i click on update, it threw this exception because the row contians a fiels which accept no duplicate values:
"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. "
How can i resolve this problem?
code snipet:
PrivateSub btnUpdate_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles btnSave.Click
rowChange = dsBoxes.tblBoxes.FindByID(m_NextID - 1)'Change a field in the row
rowChange.BoxID = txtBoxNo.Text
rowChange.Area = drpArea.SelectedItem.Text
rowChange.Entry_Date =
CDate(txtDate.Text)rowChange.Amount = txtAmount.Text
adptBoxes.Update(dsBoxes)
EndSubPrivateSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMyBase.PreRenderDim cmdUpdateAs OleDbCommandBuilder =New OleDbCommandBuilder(adptBoxes)
adptBoxes.Update(m_dtBoxes)
End subThanks alot

