IEnumerable - Linq select query with OrderBy
#Code Behind
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] MArt = { "Artists", "Musical", "Musical Artists", "Artists Musical" };
IEnumerable<string> aArt =
from art in MArt
orderby art ascending
select art;
foreach (var artist in aArt)
{
Response.Write(artist);
Response.Write("<br/>");
}
}
}
Note: Set orderby ascending or descending as per your requirement.