从数据库中显示文本框中的下一个ID? [英] Show next ID in textbox from database?

查看:112
本文介绍了从数据库中显示文本框中的下一个ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在文本框中显示下一个ID。

如果在我的数据库表中最后一个ID为ID-0008,那么在文本框中它会在新用户注册时显示ID-0009。

请帮助....

I Want display next id in textbox.
If in my database table last id ID-0008 then in textbox it show ID-0009 when new user come for registration.
Please help ....

推荐答案

请按照以下链接查找您的问题...



如何获得最大ID在表格中[ ^ ]



http://stackoverflow.com/questions/5501142/get-max-value-for-identity-column-without-a-table-scan [ ^ ]



谢谢

AARIF SHAIKH
Please follow below links for your problem...

How to get max id in a table[^]

http://stackoverflow.com/questions/5501142/get-max-value-for-identity-column-without-a-table-scan[^]

Thanks
AARIF SHAIKH


阅读全文并采用选项3自动生成自定义ID。 />
http://www.sqlteam.com/article/ custom-auto-generated-sequences-with-sql-server [ ^ ]
Read the whole article and adopt Option 3 to auto generate custom ID.
http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server[^]


您问题的解决方案。



< a href =http://www.codeproject.com/Questions/675397/I-am-stuck-with-this-Query-in-sql-server?arn=0>同一问题 [ ^ ]



建议:



这是我认为最糟糕的想法,不要尝试在页面加载时显示文本框上的下一个ID,如果两个或三个用户一次打开同一页面那么会发生什么?

每个文本框上都有相同的下一个ID,因此可以在表格中插入重复的ID。
Solution for your Question.

Same Questions[^]

Suggestion:

This is the worst idea i think , Do not try to Display the next Id on the Textbox while on Page Load,If two or three user's open the same page at a time then what will happen?
Each have the Same next Id on the Text Box , So there is a possibility to Insert duplicate Id on Table.


这篇关于从数据库中显示文本框中的下一个ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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