S
Steve Amey
Hi All
I have a DataTable that has the AutoIncrement properties set, but when I add
a new row it doesn't use the values I'd expect and is causing an error.
For example:
MyTable.Columns("PKColumn").AutoIncrement = True
MyTable.Columns("PKColumn").AutoIncrementSeed = -1
MyTable.Columns("PKColumn").AutoIncrementStep = -1
Dim oRow As DataRow = MyTable.NewRow
'// oRow("PKColumn") = 12 I'd expect it to be a negative figure, and for
each Row I add it decreases by 1
MyTable.Rows.Add(oRow) '// Causes error the second row that's added cos the
PK value already exists amd is unique.
Has anyone else experience this??
Regards,
Steve.
I have a DataTable that has the AutoIncrement properties set, but when I add
a new row it doesn't use the values I'd expect and is causing an error.
For example:
MyTable.Columns("PKColumn").AutoIncrement = True
MyTable.Columns("PKColumn").AutoIncrementSeed = -1
MyTable.Columns("PKColumn").AutoIncrementStep = -1
Dim oRow As DataRow = MyTable.NewRow
'// oRow("PKColumn") = 12 I'd expect it to be a negative figure, and for
each Row I add it decreases by 1
MyTable.Rows.Add(oRow) '// Causes error the second row that's added cos the
PK value already exists amd is unique.
Has anyone else experience this??
Regards,
Steve.