Use following code snippet. create one function as below :
public string NewEmpId()
{
string strTempId, strMaxNum;
strMaxNum = "2";
if (strMaxNum == null || strMaxNum == "")
{
strMaxNum = "0";
}
strTempId = Convert.ToString(Convert.ToInt32(strMaxNum) + 1);
if (strTempId.Length == 1)
{
strTempId = "000" + strTempId;
}
else if (strTempId.Length == 2)
{
strTempId = "00" + strTempId;
}
else if (strTempId.Length == 3)
{
strTempId = "0" + strTempId;
}
string strQuoteId = "EMP" + strTempId;
return strQuoteId;
}
than call this function as below :
string strNewEmpId = NewEmpId();