Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 没有局域网自动化?[增量1]_C# - Fatal编程技术网

C# 没有局域网自动化?[增量1]

C# 没有局域网自动化?[增量1],c#,C#,我想找到一个解决我的发票号码自动化问题的方法。 我有3个用户通过局域网连接。现在每个人都可以同时省钱了。 但这个数字必须按优先级递增 我也做了,但不满意…因此我需要更好的建议 令人困惑的是,我习惯于像下面这样保存 var InvoiceVar1 = InvoiceDAp.InsertCommand.Parameters; InvoiceVar1.Add("@invoice_no", SqlDbType.VarChar, 10,"invoice_no"); var InvoiceV

我想找到一个解决我的发票号码自动化问题的方法。 我有3个用户通过局域网连接。现在每个人都可以同时省钱了。 但这个数字必须按优先级递增

我也做了,但不满意…因此我需要更好的建议

令人困惑的是,我习惯于像下面这样保存

var InvoiceVar1 = InvoiceDAp.InsertCommand.Parameters; InvoiceVar1.Add("@invoice_no", SqlDbType.VarChar, 10,"invoice_no"); var InvoiceVar2 = InvoiceDAp.UpdateCommand.Parameters; InvoiceVar2.Add("@invoice_no", SqlDbType.VarChar, 10,"invoice_no"); var InvoiceVar1=InvoiceDAp.InsertCommand.Parameters; 添加(“@invoice_no”,SqlDbType.VarChar,10,“invoice_no”); var InvoiceVar2=InvoiceDAp.UpdateCommand.Parameters; 添加(“@invoice_no”,SqlDbType.VarChar,10,“invoice_no”); 那么,在何处将发票号增加其最大值(发票号)的1

谢谢

为什么不在数据库中添加一列呢


这样,当插入新行时,列将自动递增。

huh?您想用一个简单的SQL语句来实现这一点,是吗?为什么不编写一个存储过程并在sql server上执行此操作?使用sql server的自动增量功能?