Create asp.net az list

I could do this myself given the time, but does anyone have a good asp.net implementation of the az list coming from a SQL query. I would like it to come in the form:

A
aardvark
anagram
apple

B
barry
brown ....

That is, each record is a link.

0


source to share


3 answers


Whatever your sql, just add Upper(Substring([myfield],1,1)) AS Letter

to the picklist. Then it's just a matter of displaying the letter as it changes.



Unfortunately, this may be easier said than done. ASP.Net doesn't have very good built-in support for control / break style inference.

+1


source


You need to select the "name" column and the "link" column. Order the list by name "name" in ascending order. In your ASP.Net, you need to check when the first letter of the string changes ... if it changes, write the first letter to get what you want.



0


source


I wonder if you can do something like this, but I'm not sure if you can order by merge.

select word from 
    (select word from table 
     union all 
     select Upper(Substring([word],1,1)) as letter from table
     ) t order by word

      

0


source







All Articles