Pravin Ghadge

Pravin Ghadge

  • NA
  • 2.5k
  • 357.4k

Linq

Dec 17 2010 2:07 AM

Iam using VS 2008
I want to add country in Dropdownlist.
I have used following code:
List<string> Country = GetCountryList();

var sortedCountry = from c
in Country orderby c select c;
// var sortedCountry = from c in Country orderby c select c;
ddlCountry.DataSource = sortedCountry;
ddlCountry.DataBind();
 
But iam facing error on line:var sortedCountry = from c in Country orderby c select c;
I have also used foll. namespaces:
using
System.Collections.Generic;
using
System.Globalization;
using
System.Linq;

Answers (7)