Recently made the move to from ACCESS to SQL and have run into a problem that I completely do not understand. The table is structured as can be seen below.

I use the table for a dgv list that has frequently changing data. The table displays selected elements of the table when required. The rows consist of information from two different tables.

This table is displayed as can be seen below. One of the choices with the list is the ability to add a record. I had already worked out the part about adding a record. However, I was at the point that I needed to figure out how to keep the application from duplicating any existing records. As part of that process, I intentionally duplicated one of the records. This is where the problem with the database occurred.

The problem is that now that I have duplicate records, I am unable to delete either one or both of them and get the error seen below. That, by the way, is the error thrown from SQLExpress. The error that is thrown when I try to do the same thing in Visual Studio is worded a bit differently but says the same thing. Visual Studio did give me a place to look up information, but that was completely unhelpful and irrelevant, as far as I could tell.

So here is my question. I have two identical records in the same table. I am unable to delete either one or both of them. I have no idea how to correct this and be able to use the table. I would also like to know why the table will not accept identical records. I have set nothing up to keep it from doing that and do not understand why the table would quibble over having a duplicate record. I can think of many reasons why that might sometimes be desirable, although not for my application.



Name:  screenshot.jpg
Views: 1269
Size:  21.0 KB

Name:  screenshot2.jpg
Views: 1240
Size:  43.8 KB

Name:  screenshot.jpg
Views: 1262
Size:  44.5 KB

Name:  screenshop.jpg
Views: 1350
Size:  45.4 KB