Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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);

  • *Experts*
Posted
textBox2.Text = table.Item[key]

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted

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;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...