c# - Auto update primary key after deleting information -


Anyone know how to solve this ID problem?

For example:

  id | Message 1 | Hello 2 Philemon 3 | Car & lt; - Delete this line 4. Fixed 5 Bye   

When you delete the third line, the ID will automatically update the update and the ID after the line.

  id Message 1 | Hello 2 Philemon 3 | Fix 4 BE   

More info:

  Private zeros btnDel_Click {Object Sender, EventArgs E} {use (testEntities Setupctx = new testEntities ()) {int id = Int32.Parse (lblID.Text); Var DeleteSh = (Setupctx.shifthours in delsh, select delsh.idShiftHours == ID delsh). Single (); Setupctx.DeleteObject (DeleteSh); Setupctx.SaveChanges (); TxtStart.Text = ""; TxtStop.Text = ""; This.Edit_Shift_Hours_Load (empty, EventArgs.Empty); MessageBox.Show ("The selected shift time has been removed."); }}   

This line is a code to delete, after deleting it, I need an ID to auto update so that it fills the deleted ID in the next data. Currently I am able to delete the information but the ID is identical.

Do no do so, suppose someone links to your page And, before you delete some indexes, suddenly some of the 1234 references are completely different.

This will be a concurrency and usable nightmare.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -