If I delete in between one record in master table, next auto generate id gives duplicate value
how to solve this
string empid = "AE000";
con.Open();
SqlCommand cmd = new SqlCommand("select Count(REGISTRATION_ID) from CANDIDATE_MASTER", con);
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
i++;
Label1.Text = empid + i.ToString();
REGISTRATION_ID
AE0002
AE0004
AE0005
AE0006
If i execute that code ,label will get the value like 'AE0005'
i want to generate next id like 'AE0007'
Nitin SontakkePosted Sep 12, 2016, 3:09 AM
Nitin SontakkePosted Sep 12, 2016, 4:48 AM
Guruprasad ShreegiriPosted Sep 12, 2016, 4:00 AM
Guruprasad ShreegiriPosted Sep 3, 2016, 3:48 AM
Abhishek ChadhaPosted Sep 3, 2016, 3:45 AM