Click here to Skip to main content
15,921,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select REPLICATE ('0',8-DATALENGTH (EmployeeCode ))+EmployeeCode as 'EmpCode' from TBL_DKCSV 

How to use above from windows forms application to show in gridview ?
Posted
v2

1 solution

Hi,

Your C# code would be,
C#
var newEmployeeCode = EmployeeCode.PadLeft(8,'0');

Best luck
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900