Author: junlo | Posted on: 10/18/2008 6:24:19 PM | Views : 355

i want bind the data from a table to the listbox in alphabetical order. Below is my code, but i found that the data was not showed in alphabetical order. How to show the data in alphabetical order?Dim drow As DataRow
Dim cnt As Integer = 0
dt = mClas.GetDataTable("SELECT specialtyID, spec_name FROM specialty where spec_status=1 order by spec_name ASC")

For Each drow In dt.Rows
cbSpecialty.Items.Add(drow("spec_name").ToString)
cbSpecialty.Items(cnt).Value = drow("specialtyID").ToString
cnt = cnt + 1
Next
  ...

Go to the complete details ...