How to Format a string in c#
-
hai everyone , My problem is i have a employee code like EMPLOYEE i would like to change this to EMPLOYEE000001,EMPLOYEE000002 this format. How can i do this? with c# please help me :(( Arunkumar
Arunkumar
-
hai everyone , My problem is i have a employee code like EMPLOYEE i would like to change this to EMPLOYEE000001,EMPLOYEE000002 this format. How can i do this? with c# please help me :(( Arunkumar
Arunkumar
-
hai everyone , My problem is i have a employee code like EMPLOYEE i would like to change this to EMPLOYEE000001,EMPLOYEE000002 this format. How can i do this? with c# please help me :(( Arunkumar
Arunkumar
Where is the employee code stored? How do you determine which EMPLOYEE should be EMPLOYEE00001 and which EMPLOYEE00075? We need more information before we can give you a meaningful answer.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
It is
string.Format("EMPLOYEE{0:D6}",EmployeeNumber);
-
Where is the employee code stored? How do you determine which EMPLOYEE should be EMPLOYEE00001 and which EMPLOYEE00075? We need more information before we can give you a meaningful answer.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
André Kraak,ProEnggSoft Thank you for your answer and it's works! OriginalGriff, the employee code is stored in the database and it just a field for naming(like a roll no) a employee. i have a id filed for managing employees. when admin add a employee program fetch last inserted employee code. i writed a program for increasing the count. Thanks,
Arunkumar.t
-
André Kraak,ProEnggSoft Thank you for your answer and it's works! OriginalGriff, the employee code is stored in the database and it just a field for naming(like a roll no) a employee. i have a id filed for managing employees. when admin add a employee program fetch last inserted employee code. i writed a program for increasing the count. Thanks,
Arunkumar.t
Arunkumar.Koloth wrote:
OriginalGriff, the employee code is stored in the database and it just a field for naming(like a roll no) a employee. i have a id filed for managing employees.
when admin add a employee program fetch last inserted employee code. i writed a program for increasing the count.If you're using SQL Server why are you not using the identity column instead? http://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx[^] If you're not using SQL server there's probably some similar function in your database.
-
Arunkumar.Koloth wrote:
OriginalGriff, the employee code is stored in the database and it just a field for naming(like a roll no) a employee. i have a id filed for managing employees.
when admin add a employee program fetch last inserted employee code. i writed a program for increasing the count.If you're using SQL Server why are you not using the identity column instead? http://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx[^] If you're not using SQL server there's probably some similar function in your database.
Marcus_2, My project is in MySQL server so i thing it is required.. suggest me if you have any other great idea. :-O Thank you Arunkumar
-
Marcus_2, My project is in MySQL server so i thing it is required.. suggest me if you have any other great idea. :-O Thank you Arunkumar
Hi I've no idea about MyQL, but perhaps this might be helpful or at lest something to read and remember the functionality for future use: http://bytes.com/topic/mysql/answers/652076-how-create-identity-column-mysql It depends on how you do it, I just read this
Arunkumar.Koloth wrote:
i writed a program for increasing the count.
and tried to give an idea about using a feature built into a lot of databases. ;)
-
Arunkumar.Koloth wrote:
OriginalGriff, the employee code is stored in the database and it just a field for naming(like a roll no) a employee. i have a id filed for managing employees.
when admin add a employee program fetch last inserted employee code. i writed a program for increasing the count.If you're using SQL Server why are you not using the identity column instead? http://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx[^] If you're not using SQL server there's probably some similar function in your database.
Thanks For the link Marcus_2