I would like to find a soluttion to my problem for invoice number automation.
And I have 3 users connected via LAN. Now everybody can save at same time.
But the number has to be increment by priority.
I also did already, but not satisfied….hence I need better advise…
The confusion is that I use to save like the below…
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");
So where to increase the invoice_no by 1, of its max(invoice_no)…?
Thanks
Why not put an Identity column in your database.
That way the column will increment automatically as new rows are inserted.