文本框中的自动编号 [英] auto number in text box

查看:158
本文介绍了文本框中的自动编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有textbox1
button1
当单击button1时,textbox1会自动增加

和sql server 2008中的table1

field1 id int(PK)
field2名称

我想在id字段中自动增加

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

推荐答案

在SQL Server Management Studio中将其IsIdentity设置为True

右键单击表",选择修改",然后选择"PK"列


这是您想要的吗?还是要在文本框中自动增加?
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?


您可以使用
select max(id) from tablename


并单击按钮可以将值增加1.


and on button click you can increase value by 1.


这篇关于文本框中的自动编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆