Dim AnimalArrayList as new ArrayList()
AnimalArrayList.Add("Dog")
AnimalArrayList.Add("Cat")
AnimalArrayList.Add("Elephant")
AnimalArrayList.Add("Lion")
AnimalArrayList.Add("Cat")
MyDropDownList.DataSource = AnimalArrayList
MyDropDownList.DataBind()
Binding with Hashtable(c#) :
Hashtable hTable = new Hashtable(); hTable.Add("1", "Hashtable Item 1"); hTable.Add("2", "Hashtable Item 2"); hTable.Add("3", "Hashtable Item 3"); hTable.Add("4", "Hashtable Item 4"); dropHashtable.DataSource = hTable; dropHashtable.DataBind();Binding with Array(c#,vb) :
int[] Hour = new int[24];
for (int i=0; i <=24, i++)
{
ddlHour.Items.add(Hour[i]);
}
No comments :
Post a Comment