how to use data bind in dropdown using linq code ( linq to sql )
please help me..
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
Amit Kumar SinghRank #562 · 4.3K reputationPosted Feb 17, 2016, 2:44 AM EST
protected void BindMarketCodes() { using (var dataContext = new LINQOmniDataContext()) { //bind to Country COde droplist dd2.DataSource = from p in dataContext.lkpMarketCodes orderby p.marketName select new {p.marketCodeID, p.marketName}; dd2.DataTextField = "marketName"; dd2.DataValueField = "marketCodeID"; dd2.DataBind(); } }