以下代码中向一个职员信息表中添加工号,姓名,性别,年龄,点击添加键后在右边的listbox中显示姓名,四个文本框即清空,当点击listbox中的姓名时,需在左边的文本框中返回相应的值。但以下代码可添加信息,但当点击listbox中的姓名时,发生错误,四个文本框的内容自然就显示不出来,不知道是啥原因?请教各位高手!//生成各个哈希表的实例
private System.Collections .Hashtable  har1=new Hashtable ();
private System.Collections .Hashtable  har2=new Hashtable ();
private System.Collections .Hashtable  har3=new Hashtable ();
private void button1_Click(object sender, System.EventArgs e)
{
//在各个哈希表中添加key and value
har1.Add (this.textBox1 .Text ,this.textBox2.Text );
har2.Add (this.textBox3 .Text ,this.textBox2 .Text );
har3.Add (this.textBox4 .Text ,this.textBox2 .Text );
this.listBox1 .Items .Add (this.textBox2 .Text );
//将四个文本框清空
this.textBox1 .Clear ();
this.textBox2 .Clear ();
this.textBox3 .Clear ();
this.textBox4 .Clear (); }

private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
//string value1=this.listBox1 .SelectedValue .ToString ();
//从列表清单中选中的值赋给value1,
string value1=this.listBox1.SelectedItem .ToString ();
//通过value1,取出哈希表对应值的键,j1,j2,j3表取出对应键的值
string j1=(string)har1[value1];
string j2=(string)har2[value1];
string j3=(string)har3[value1];
//将J1,J2,J3的值放于textbox1,textbox3,textbox4
this.textBox1 .Text =j1;
this.textBox2 .Text =this.listBox1 .SelectedValue .ToString ();
this.textBox3 .Text =j2;
this.textBox4 .Text =j3;