Collections key and values

Jedhi

Well-known member
Joined
Oct 2, 2003
Messages
127
I have a table consist of a key and a value. Where the key is the security number and the value is the name.

I would like to pick out the value that belongs to the key, but how do I do this ???

Code:

System.Collections.ICollection keys = table.Keys;

foreach(string key in keys)
{
string[] myItems = new string[]
{
textBox1.Text = key,
textBox2.Text = ??????
};
ListViewItem lvi = new ListViewItem(myItems);
listView1.Items.Add(lvi);
}
Controls.Add(listView1);
 
I understand you point. The problem is just that I can not do what you suggested. Not even values[key]. Any suggestion how to solve the problem ??

System.Collections.ICollection values = table.Values;
 
Back
Top