like following
first i get the currunt date ans concatinate it in to the string
DateTime _date = DateTime.Now;
int day = _date.Day;
int month = _date.Month;
int year = _date.Year;
int i=0;
string uid = "" + day + "" + month + "" + year + "" + ++i + "";
but insted of ++i i want auto generated value based on previous inserted id,,,
so that i first fetch previous id from database table
and i got like this 1111201304
red is date and green is auto generated number
so now how can i remove first 8 digit so that perform addition operation on remain digits.......

VulpesPosted Nov 11, 2013, 2:13 PM
string prev_uid = "1111201304"; // recovered from database in practice
DateTime _date = DateTime.Now;
int day = _date.Day;
int month = _date.Month;
int year = _date.Year;
int i = int.Parse(prev_uid.Substring(8)) + 1;
string uid = "" + day + "" + month + "" + year + i.ToString("D2");
Console.WriteLine(uid); // 1111201305