从c#win中的数据库(ACCESS)获取下一个唯一编号。形成 [英] Get next unique number from database (ACCESS) in c# win. form

查看:216
本文介绍了从c#win中的数据库(ACCESS)获取下一个唯一编号。形成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://www.dropbox.com/s/x3wvagpujtnm6oq/Table%20Structure%201 .png [ ^ ]


上述链接中的
是我的数据库结构。现在,我如何获取Access数据库中的下一个唯一号码?即3,5。

https://www.dropbox.com/s/x3wvagpujtnm6oq/Table%20Structure%201.png[^]

in the above link is my database structure. Now, how do i get the next unique number in Access database? viz. 3,5.

推荐答案

不要。



这是个坏主意,因为你不喜欢知道下一个号码是你将要使用的那个:Access有自己的多用户数据库 - 它就是,如果你这样使用它会带来巨大的悲痛 - 所以如果两个用户得到下一个号码只有其中一个能够使用它。你永远不应该试图预测一个值是什么 - 等到你创建记录并实际使用该值 - 然后你有准确的数字。
Don't.

It's a bad idea, because you don't know that the "next number" is the one you will use: Access has pretensions to be a multi user capable database - and it is, it just gives huge amounts of grief if you do use it like that - so if two users get "the next number" only one of them will be able to use it. You should never try to "predict" what a value will be - wait until you create the record and actually use the value - then you have the accurate number.


这篇关于从c#win中的数据库(ACCESS)获取下一个唯一编号。形成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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