如何增加文本框的字段名称(id),以便每个用户都获得唯一的应用程序ID [英] how to increment a text box field name(id) so that every user gets unique application id

查看:124
本文介绍了如何增加文本框的字段名称(id),以便每个用户都获得唯一的应用程序ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,在我的项目(租车系统)中,在Windows窗体应用程序中,我希望用户填写付款表格时生成一个唯一的收据编号.在包含收据编号,电子邮件和预订日期的取消表格中,当他填写收据编号时,他的email_id和预订日期应该是自动发送的.我正在让用户能够使用用户名,电子邮件等所有字段,预订表包含预订的日期.请帮助我...

解决方案

在数据库中,将id字段设置为auto_increment以获得连续的唯一序列.生成用于随机查找(即无法猜测)的ID的GUID-但是GUID通常不索引以及不包含整数,因此即使您决定对显示的内容更加不透明,我还是建议使用auto_increment内部ID作为主键用户.

预订应与用户绑定,然后您想要的查询类似于:
选择"booking.receiptno","booking.bookingdate","user.email"(来自预订),成为左侧的订户加入用户.user= user.username,其中booking.receiptno = @receiptno

使用Guid.NewGuid(),它将为您提供唯一的标识符.


创建一个GUID().那是在.net中生成的唯一密钥.


hello, in my project(car rental system) ,in of the windows form application i want a unique receipt number generated when user completes the payment form.In cancellation form containing receipt no,emailand booked date when he fills receipt no ,his email_id and booked date should come automatically.i am having the user atble with all the fields like username,email...and booking table consists of booked date.plz help me...

解决方案

In a database, set the id field to auto_increment for a unique, consecutive sequence. Generate GUIDs for random looking (i.e. unguessable) IDs – but GUIDs typically don''t index as well as ints so I recommend having an auto_increment internal ID as the primary key even if you decide you want to be more opaque with what you display to the user.

A booking should be tied to a user and then the query you want is something like:
select booking.receiptno, booking.bookingdate, user.email from booking left join user on booking.user = user.username where booking.receiptno = @receiptno


Use Guid.NewGuid() it will give you a unique identifier.


create a GUID(). That is a unique key generate in .net.


这篇关于如何增加文本框的字段名称(id),以便每个用户都获得唯一的应用程序ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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