0

I am not able to insert data into my table anymore!
Here's my table design.
enter image description here

intId is the Primary Key, there's no explicit unique constraint defined on it, has identity increment set to 1 and identity seed to 1.

I am inserting data into this table thru LINQ.

testDB.tbl_Vehicle.InsertOnSubmit(newVehicle);
testDB.SubmitChanges();

All this used to work till now, and all of a sudden it stopped working!
It now says

A duplicate value cannot be inserted into a unique index. [ Table name = tbl_Vehicle,Constraint name = PK_tbl_Vehicle ]

More info: This desktop application has 1 executable and 1 .sdf file. It was developed on Win 7 and recently was moved to Win XP system. But that shouldn't be a problem as there are other tables I am inserting into with similar logic and table design.

Null Head
  • 2,877
  • 13
  • 61
  • 83

1 Answers1

0

Do one thin make use of SQL profiler and check the query fire on insert statement.

More on check the database Table again and if possbile set the seed for the primary i.e identity column.

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263