VB.net如何拥有像000001这样的客户ID? [英] VB.net how to have Customer ID Like 000001?

查看:57
本文介绍了VB.net如何拥有像000001这样的客户ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Good Day,请帮我一起使用这样的格式的cutomer ID:000001,然后下一个客户编号将是000002,000003,000004,很快..任何人都可以这样做,请帮帮我,我需要那个这种格式的id ....感谢无论如何,提前谢谢..







< br $> b $ b



有我的热情问候

Nathan

解决方案

别。

类似的东西的数据库值应该是数字,而数值不是前导零。



相反,用前导格式化ID当您将其呈现给用户时,以及在最后可能的时刻,将其归零。在VB中,这很简单:只使用格式为{0:000000}的String.Format,或者使用ToString(D6)

Hello Good Day, Please help me with cutomer ID with a format of like this : 000001 , then the next customer number will be 000002,000003,000004, and soon.. can anyone done this , please help me i need that kind of format of id.... thanks anyway, thanks in advance..






have my warm regards
Nathan

解决方案

Don't.
Database values for things like that should be numeric, and numeric values do not have leading zeros.

Instead, format the ID with leading zeros when you present it to the user, and at the last possible moment. In VB, that's pretty easy: just use String.Format with the format "{0:000000}", or ToString("D6")


这篇关于VB.net如何拥有像000001这样的客户ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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