I have being working with doctor patient portal project
I have a database design
column Datatype
appointment_id int(set as primary key and identity specification as true)
patient_name varchar(50)
doctor_name varchar(50)
date date
time time
here database is empty or null, not inserted anything.
I want to get automated generated appointment id .in the textbox, ie if first patient going to book appointment the id is 1. if another patient comes the id is 2 and goes on... how to do that in asp.net c#?
Sachin SinghPosted Nov 4, 2022, 11:46 AM
You don't need to do anything from asp.net side,
you just need to alter your schema as shown below
so when you will insert data from asp.net form you don't need to send appointmentId as it is identity sql server will take care of it and will increase it each time a new record is inserted.