how do i sort information in a listbox by name (that is, alphabetical order)? im doing c# programming n using microsoft visual studio .net 2003.
c#dummie 0
Light Poster
Recommended Answers
Jump to PostIf you are using a SELECT statement, which I would assume you are, just add an ORDER BY clause to that statement and voila.
Jump to PostHere is the code which shows you both:
(ps: button click even reverses the list, so you can see the difference in the code)public Form1() { InitializeComponent(); string[] array = new string[] { "D", "C", "A", "E", "B" }; Array.Sort(array); listBox1.Items.AddRange(array); } private void buttonInvert_Click(object sender, …
All 6 Replies
Paladine 138
Master Poster Team Colleague
SHIHAB.KV 0
Newbie Poster
Farhad.idrees 1
Junior Poster in Training
Mitja Bonca 557
Nearly a Posting Maven
Mitja Bonca 557
Nearly a Posting Maven
jugosoft 25
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.