i wonder how i can autom increment primary key of table when ever i insert a new record using asp.net web form? i want to insert some data to sql server db using web forms.Thank u and looking forward to your replyes.ThanksYour database table needs to be set to do the incrementing
Identity - Yes
Identity Seed - 1
Identity Increment - 1
EricYour database table needs to be set to do the incrementing
Identity - Yes
Identity Seed - 1
Identity Increment - 1
Eric
Many thanks to your reply. Well i went to sql server EM and set the indentity to yes and the data type is smallint .but now when i insert records it start incrementing from 113 not from 0/one !! Before the changes i already had some records do u think that is the problem ?Thanks and looking forward to your reply.It is starting at the last record id, it does not matter where it starts from unless you have a desire for you numbers to start at 1
EricIt is starting at the last record id, it does not matter where it starts from unless you have a desire for you numbers to start at 1
Eric
Thank u for u reply. I have the same primary key in another table and i want both primary key be the same .For example if i insert a new record in table1 , how i can add that new primary key in to another table that is using same primary key but other fields empty to be added ?
Identity - Yes
Identity Seed - 1
Identity Increment - 1
EricYour database table needs to be set to do the incrementing
Identity - Yes
Identity Seed - 1
Identity Increment - 1
Eric
Many thanks to your reply. Well i went to sql server EM and set the indentity to yes and the data type is smallint .but now when i insert records it start incrementing from 113 not from 0/one !! Before the changes i already had some records do u think that is the problem ?Thanks and looking forward to your reply.It is starting at the last record id, it does not matter where it starts from unless you have a desire for you numbers to start at 1
EricIt is starting at the last record id, it does not matter where it starts from unless you have a desire for you numbers to start at 1
Eric
Thank u for u reply. I have the same primary key in another table and i want both primary key be the same .For example if i insert a new record in table1 , how i can add that new primary key in to another table that is using same primary key but other fields empty to be added ?