Deena eliz

Deena eliz

  • NA
  • 50
  • 19.7k

how to increase value on hashtable?

May 8 2015 1:05 AM

 Hashtable HT = new Hashtable();

        private void button1_Click(object sender, EventArgs e)
        {
            int val = 0;
           
            HT.Add(textBox1.Text,val);
            HT.Add(textBox2.Text, val);
            HT.Add(textBox3.Text, val);
            HT.Add(textBox4.Text, val);
        }


here am storing textboxes data into hashtable like textbox data as key and val 0 as value..
now am entering new data into another textbox (textbox5). this new data should compare all other data in hashtable. if suppose the hashtable contain the same data means the value should be increase

private void button2_Click_1(object sender, EventArgs e)
        {
            if (HT.ContainsKey(textBox5.Text))
            {
                        // select the particular key and increse that value
            }

so here how to select the particular key and increase the value of that only..

please anybody help me..

Thanks in advance..







        

Attachment: globaldata.rar

Answers (1)