如何在注册期间为用户生成自动ID号码? [英] How to generate a automatic id number for user during registration?

查看:407
本文介绍了如何在注册期间为用户生成自动ID号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友您好..请帮帮我。我已经尝试了很多。但没有发生任何事情。

Hello friends.. Please help me with this. I have tried a lot.But nothing happened.

推荐答案

您是否针对数据库中的用户详细信息保存了这个?如果是,最好在数据库中生成它。如果需要,在保存之后将其发送到您的应用程序。您还可以在数据库中为此编号定义标识字段。您可以使用 @@身份系统功能 [ ^ ]。
Are you saving this against the user details in the database? If yes, it's best to generate it in the database itself. And if needed get it to your application after it is saved. You may also define an identity field for this number in the database. And you can retrieve the value of this field using @@Identity system function[^].


Random _r = new Random();
int id = _r.Next();


这篇关于如何在注册期间为用户生成自动ID号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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