Click here to Skip to main content
16,015,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have textbox1
button1
when click on button1 textbox1 auto increases

and table1 in sql server 2008

field1 id int (PK)
field2 name

i want to make auto increment in id field
Posted
Comments
Uday P.Singh 3-Aug-11 6:30am    
are you looking for making the field1 auto-increment in sql-server 2008? or what?

Make its IsIdentity to True in SQL server Management Studio

Right click on Table select Modify then select PK column


Is this what you want?or you want to autoincrement in textbox?
 
Share this answer
 
you can use
SQL
select max(id) from tablename

and on button click you can increase value by 1.
 
Share this answer
 
v2
Comments
kami124 3-Aug-11 6:49am    
how to get max(id) from table
thatraja 3-Aug-11 7:30am    
check the updated answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900