Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello To All,

I am Working in one windows Application inside that i have one purchase form, In purchase form i have bill no with auto increment.

For Example..

I have bill like SBN001 , SBN002 , SBN003 , SBN004

Now if i delete SBN003 billno i get SBN005 and it's work fine .. But i manually edit that no with SBN003. That Means in my database bill no stored like .

SBN001 , SBN002 , SBN004 , SBN003 now i want to check max no in this 4 bill means get SBN004 as max no and i want to Plus SBN004 with 1 ..

How i can do this please help me..


Thanks Regards
Posted

1 solution

Design problem. Do not use your "bill number" as the identifier and primary key in the database. Use an automatically generated id there. Then you can change the content of the "bill number" column as you like it.
 
Share this answer
 
Comments
Jay1902 4-Aug-14 8:22am    
i have sales_id as primary key and billno as another filed in my database..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900