Sql query
hi I have country dropdownlist I am binding it from database I want to display india first is it possible to with sql query
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
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 20, 2013, 2:37 AM EST
If you are using C#,
ddl.Items.Insert(0, itemtobeinserted);
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 20, 2013, 6:25 PM EST
hi,
I think if you have knowledge about value of Id field of India" than you can use selectedIndex property to select any value from drop down list.
dropDownList1.SelectedIndex = 5;
Please refer
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.selectedindex%28v=vs.110%29.aspx
hope this will help you.
Girish Sapariya159 reputationPosted Nov 20, 2013, 8:17 PM EST
Hanook159 reputationPosted Nov 20, 2013, 8:25 PM EST
SELECT *
FROM country
ORDER BY CASE WHEN CoutryName = 'India' THEN 1 ELSE 2 END
Praneet RaneRank #1,277 · 1.4K reputationPosted Nov 28, 2013, 7:26 PM EST