I am trying to use keyfields in a table to eliminate duplicate rows. I thought I coded for the duplicate row exception but I am now getting this error message. Can someone show me what is missing to handle this exception.
Exact Error Message:
Cannot insert duplicate key row in object 'dbo.MPI' with unique index 'NPIACCT'.
The statement has been terminated.
catch (DuplicateKeyException dke2)
MPI errObj = dke2.Object as MPI;