Problems with saving in ADO.NET, can anyone give me an idea? Here is the code:

Private Sub btnSave_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSave.Click

'm_blnADD(True) = btnADD was clicked as opposed to Cancel
If m_blnAdd = True Then
Dim newRow As DataRow
Dim rc As DataRowCollection
Dim rowValues(3) As String

'Assign values to the string array for update later
rowValues(0) = txtBookID.Text
rowValues(1) = txtBookTitle.Text
rowValues(2) = txtPubID.Text
rowValues(3) = txtPrice.Text

rc = DsTitles1.titles.Rows
m_currencyManager.AddNew()
'm_currencyManager.Position -=1
'MsgBox(m_currencyManager.Position)
newRow = rc.Add(rowValues)

'm_currencyManager.Position += 1
'm_currencyManager.Position -= 1

m_currencyManager.EndCurrentEdit()
m_currencyManager.Position += 1
daTitles.Update(DsTitles1, "Titles")
daTitles.Fill(DsTitles1)
m_currencyManager.Position = m_currencyManager.Count - 1
Else
'Editing so just save the current record
daTitles.Update(DsTitles1, "Titles")
End If

'Make boxes read only after the save
boxesReadOnly()

'Make navigation enabled
NavigationEnabled()

'Make command buttons enabled
btnAdd.Enabled = True
btnEdit.Enabled = True
btnDelete.Enabled = True

'Disable Save Button
btnSave.Enabled = False

'Switch add button to "Add"
btnAdd.Text = "&Add"

End Sub


When I get to the newRow = rc.Add(rowValues) I receive the following error message:

"An unhandled exception of type 'System.Data.ConstraintException' occured in system.data.dll

Additional information: Column 'title_id' is constrained to be unique. Value "ABC" is already present."


ABC happens to be the value of:
rowValues(0) = txtBookID.Text


There are the issues of the SQL key constraints in SQL server for this table (using the PUBS Demo database for SQL), but I eliminated that problem by testing the issue after copying the Titles table to a new table without any foriegn key constraints, still the same problem.

Any ideas? Thanks in advance for the help.

Bob