my case i have i table with identity column named invoices
when i insert in it the auto identity column assign a value
but i want the customer see the invoice no before i add it in the table
to use it in any search in th future is the any way
my q in another way
I have a form with a label that should show an invoice number. The invoice
number should be generated by sql Server using an autoincremented technique.
However, after reading several articles, it seems that I can only retrieve
this value after an INSERT has been done in the database. I want to find out
what this autoincremented before an insertion.
can i use @@identity or scope_identity()in sql
and get the last identity and add 1 on them to show customer the invoice no
or get the max value and increment 1 on it
is it solution or not
thnks in advice
Loading

kareem elhossenyPosted Jul 6, 2008, 4:15 AM
thanks my brother i'll try
Mhd HammadPosted Jul 6, 2008, 3:47 AM
to solve this problem when user click new invoice, you should insert a new empty record to got its ID of invoice then when user complete the invoice filelds and click button Add , you will update this record fileds, if the user cancel the add , delete this record
for sure you should make invoice fields in DB allow nulls or take defualt values to accept insert empty field
I hope it fit your needs