Returning the country names with no repeats

Certify and Increase Opportunity.
Be
Govt. Certified ASP.NET Programmer

Returning the country names with no repeats

Basic syntax for a drop-down list control:

<asp:DropDownList ID="DropDownList1" 
     runat="server" 
     AutoPostBack="True" 
     OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>

Common Properties of List box and Drop-down Lists:

Property Description
Items The collection of ListItem objects that represents the items in the control. This property returns an object of type ListItemCollection.
Rows Specifies the number of items displayed in the box. If actual list contains more rows than displayed then a scroll bar is added.
SelectedIndex The index of the currently selected item. If more than one item is selected, then the index of the first selected item. If no item is selected, the value of this property is -1.
SelectedValue The value of the currently selected item. If more than one item is selected, then the value of the first selected item. If no item is selected, the value of this property is an empty string(“”).
SelectionMode Indicates whether a list box allows single selections or multiple selections.

Common Properties of each list item objects:

Property Description
Text The text displayed for the item
Selected Indicates whether the item is selected.
Value A string value associated with the item.

 

Country names with no repeats

This is accomplished by selecting ‘Return only unique rows’ during choosing database comnnection screen.

Get industry recognized certification – Contact us

Menu