jeudi 11 juin 2015

How to fill sequence gap in sql visual basic application

I am developing a Billing Application. Whenever i click print button it saves the cart/listview items to the sql with unique invoice number. Consider if i delete/cancel one of invoices then there will form a gap in invoice nos. How to fill that gap??

New invoice number should be that gap number.

Eg:
invoice No______total
1_____________100
3_____________50

If the above is my sql table then how to get next invoice number as 2 and then it starts to increment from 4 onwards

Aucun commentaire:

Enregistrer un commentaire