Clear a HashTable - English training
HashTable provide a Clear() method to clear all the items.
Hashtable EmpHashTable =
new
EmpHashTable();
EmpHashTable.Add(
"Key1"
,
"Omer"
);
EmpHashTable.Add(
"Key2"
,
"Berke"
);
EmpHashTable.Add(
"Key3"
,
"Cebi"
);
protected
void
btnClear_Click(
object
sender, EventArgs e)
{
EmpHashTable.Clear();
ListBoxCloths.DataSource = EmpHashTable;
ListBoxCloths.DataBind();
lblMessage.Text =
"HashTable Items Cleared"
;
}