serial number

can i get code for generating serial number through the combination of data and product id.if date is current date and product is produce eg.p1 on the same date then serial number start from 0001,same product i.e. p1 produce on same date then its serial no is 0002,but if date or product change then serial number start from 0001.if product id is same as earlier product id then its serial number start from max of that product serial number which we get earlier.

for eg. date prodid serial number
25/03/2012 p1 0001
25/03/2012 p1 0002
26/03/2012 p1 0001
26/03/2012 p2 0001
26/03/2012 p2 0002

the serial number generation should be in this manner.


  • Try Something like this.

    public int GenerateSerial()

    { int serial = 0;

    for (int a = 0;
    a < Listofdata.Count;
    if (serial == Listofdata[a].Serial)
    a = -1;
    return serial;

    Of course this is a really simple way to go about it. More complex ways would be to use like an MD5 hash out of serialized data in combination with a timestamp to make sure it's always unique (though you'd want to put a check in anyways to make sure.

    [url=] web development company india [/url]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion