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 SontakkeRank #264 · 9.6K reputationPosted Sep 11, 2016, 11:09 PM EDT
Abhishek ChadhaRank #402 · 6.2K reputationPosted Sep 2, 2016, 11:45 PM EDT
Guruprasad Shreegiri43 reputationPosted Sep 2, 2016, 11:48 PM EDT
Guruprasad Shreegiri43 reputationPosted Sep 12, 2016, 12:00 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 12, 2016, 12:48 AM EDT