Author: jerlyn90 | Posted on: 1/1/2010 10:22:02 PM | Views : 548

Hi, 
I've a web form whereby my invoice number is "CS00x" whereby x is the auto number supposedly to be generated using the following codes:



char[] trim = { 'C', 'S' }; string ID; int IDno; try { ID = (string)rdr["sOrderID"]; } catch { ID = "0"; } rdr.Close(); IDno = int.Parse(ID.TrimStart(trim)) + 1; switch (IDno.ToString().Length) { case 1: ID = "CS00" + IDno.ToString(); break; case 2: ID = "CS0" + IDno.ToString(); break; case 3: ID = "CS" + IDno.ToString(); brea ...

Go to the complete details ...