Logic for generation code in C#
Posted on 2007-10-18
I am working on C#, ASP.Net 1.2, and MSSQL 2000
In my database I have the code like C02, C03...C10, S01, S02, S05... etc. where first letter stands for the supplier name
Now, When I create the new code for supplier it should take the first letter from suppler name and the next 2 availabe digits
means if the max code availabe for supplier Cxyz is C20 then the next code generated for the supplier should be C21.
How to find the next available code and set the code to the supplier.
I require the logic for this