Let's say I have a table with the column [ID] set as Number / Replication ID / Required=Yes / Indexed=Yes(no duplicates). [ID] is set as the primary key. No other indexed columns.
Routine to add 100 \"Test\" records....
- Code: Select all
Dim objOrderInfo As New GW.DAL.Order
objOrderInfo.ConnectionString = syConnectionStringTransfer()
Dim i As Integer
For i = 1 To 100
Dim newGuid As Guid = Guid.NewGuid
.ID = newGuid
.FirstName = \"John\"
.LastName = \"Doe\"
.PhoneNumber = \"770-555-1212\"
.PIN = \"12345\"
.BeginningBalance = 10
.Purchases = 6
.EndingBalance = 4
.OrderDateTime = Now
When I save the 100 orders, I get the following error:
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.
(No rows are saved to the table.)
This all seems very basic, what am I doing wrong here?