I have this code :
<asp:DropDownList AutoPostBack=False id="nation" runat="server" DataTextField="Title" DataValueField="Desc"></asp:DropDownList>
DataView nation = new DataView(new MyObjects().RsTable);
nation.Sort = "Title DESC";
DropNazioni.DataSource = nation;
DropNazioni.DataBind();
What I'd like to do is :
- Put only distinct values in the DropDownList (so if I have 2 values "Italy", insert only one time Italy);
- Upper the strings in the DropDownList (so if I have Italy, print ITALY);
Tried nation.Distinct()
or nation.ToUpperString()
but seems that these methods don't exists.
I'm on (unfortunatly) an old project, with .NET 2.0, so no LINQ.