Converting HashTable into ArrayList and binding to DataControls

Posted by SheoNarayan under C# category on | Views : 10755
Following code snippet shows how to convert HashTable into ArrayList and Bind to DataControls.

Class MyClass
public static ArrayList HashTableToArrayList(Hashtable hTable)
ArrayList list = new ArrayList();
foreach (int key in hTable.Keys)
return list;

Now you can use above function to Bind any DataControls like GridView.

GridView1.DataSource = MyClass.HashTableToArrayList(myhashTable);

Comments or Responses

Login to post response