Binding listbox content to another listbox
<p>I have 2 listboxes in my form and I binded some data to first listbox from the database. Now I have to show the selected items of the first listbox in the second listbox when a buton is pressed. im able to show one selected item at a time, but im unable to show multiple selected items. I used a hash table and the follwing code please help me im new to this concept thank in advance.</p>

<pre><code>Hashtable ht = new Hashtable();
ht.Add(listbox1.SelectedValue.ToString(),listbox1.Text.ToString());
int i = 0;
foreach (string ent in ht.Values)
{   
    string[] name = new string[listbox1.Items.Count];
    for (i = 0; i &lt; listbox1t.SelectedItems.Count; i++)
    {     
        name[i] = listbox1.Text;
        this.listbox2.Items.Add(name[i]);
    } 
    listbox2.DisplayMember = ht.Values.ToString();
    listbox2.ValueMember = ht.Keys.ToString();
}
</code></pre>
