Abolfazl

Abolfazl

  • NA
  • 184
  • 80.9k

how to set primary key after delete a record ?

Mar 23 2014 3:43 PM
hi
i have a table with a column set to primary key and is identify as yes.when i delete a record from table, primary key field deleted but primary key steel start from where old data has primary key.for example a record with primary key set to 1,i delete it but new record primary key set to 2.
i need to set it automatically to 1.
i use linq to sql for connect to database and i don't know sql server commands.i want to set it with linq to sql and c#.
thanks

Answers (4)