Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Generate next ID's with prefix 'AE' to label C# to sql
Guruprasad Shreegiri
Sep 3 2016 3:40 AM
301
Reply
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'
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
contact list project
How to add 30 days to date and display color based on date