correct the code
string query ="SELECT * FROM lwpos_categories ORDER BY name WHERE parent_id= " + ddlCategory.SelectedValue ;
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dhara Patel108 reputationPosted Nov 23, 2019, 4:31 AM EST
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 23, 2019, 6:27 PM EST
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Nov 24, 2019, 10:35 PM EST
can you please try below code and let me know if not working.
string query = "SELECT * FROM lwpos_categories WHERE parent_id = " + ddlCategory.SelectedValue + " ORDER BY name ";
Order by clause used in SQL side after the where condition if you used where clause in query.
and defualt is asc order of you not write asc keyword in query.
Thanks