asp.net - Generating unique 3 character city code through c# -
i have generate 3 character city code '001' '999'. after should 'a01' 'a99', 'b01' 'b99' , on. how generate through c# code , insert city table. using sql server 2008
build linq
var list = (from number in enumerable.range(1, 99) select string.format("{0:000}", number)) // 1 - 999 .union (from number in enumerable.range(1, 26 * 100) number % 100 != 0 select string.format("{0}{1:00}", (char)(97 + number / 100), number % 100)); // ?01 - ?99 ? z
but minded, city code using meaningless human, should decide coding scheme use.
Comments
Post a Comment