i'm helping a friend and i'm almost done with the program what i can't figure out is i need to sort the number of votes from lowest to highest my database is just ms access and i'm trying to display the photos of the candidates who got the highest votes but i'm so lost here i hope somebody can guide me.
wilen
0
Newbie Poster
Recommended Answers
Jump to PostTo sort as part of your query, use an
ORDER BY
clause.Does that help? If not, please post some code so we can get at specifics more easily.
Jump to PostOk. If that's the case, there's no need retrieve the record(s) with the highest number of votes.
You could use a DataAdapter instead of DataReader for your
sqlcouncil
query (and select all fields, not just num_of_votes), place the result into a DataTable, and retrieve the first 8 rows.
Jump to PostFirst of all, unless you place all those pictureboxes in a list<of pictureboxes>, you cannot fill them using a loop; you're gonna have to fill them manually.
Secondly, there is no need for con.Open.
All 11 Replies
gusano79
247
Posting Shark
wilen
0
Newbie Poster
wilen
0
Newbie Poster
scudzilla
32
Junior Poster
wilen
0
Newbie Poster
scudzilla
32
Junior Poster
wilen
0
Newbie Poster
scudzilla
32
Junior Poster
wilen
0
Newbie Poster
scudzilla
32
Junior Poster
wilen
0
Newbie Poster
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.