title: Display count after updating every record
body: <p>I have one xml file. File contains products name,product price.</p>
  
  <p>I am updating product price of all products.But  I want to display the count after every record updated.</p>
  
  <p>like If i have 10 products in xml file then it will show</p>
  
  <ul>
  <li>1 updated of 10</li>
  </ul>
  
  <p>then </p>
  
  <ul>
  <li>2 updated of 10 </li>
  </ul>
  
  <p>and finally it will show 10 updated of 10.</p>
  
  <p>I am displaying progress bar but I want to display count of record also while updating.</p>
  
  <p>Following is the C# code.</p>
  
  <p>Here I am loading the xml file then it will read the <code>productcode</code> node and update the price with what we have enter in textbox.</p>
  
  <p>After updating every product price I want to display the record count.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Text;
  using System.Windows.Forms;
  using System.IO;
  using System.Xml;
  
  using APIReaderLib;
  using APIReaderLib.DataObjects;
  
  namespace VAPIReader
  {
      public partial class UpdateProducts : Form
      {
          public UpdateProducts()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              try
              {
                 XmlDocument m_xmld = null;
                 XmlNodeList m_nodelist = null;
                 XmlNode m_node = null;
                 XMLPostManager manager = new XMLPostManager();
  
                 m_xmld = new XmlDocument();
  
                 m_xmld.Load("C:\\Users\\pooja.b.EDREAMZ\\Desktop\\s&amp;p\\Final1.xml");
  
                 m_nodelist = m_xmld.SelectNodes("/xmldata/Products");
  
                 foreach (XmlNode m_node_loopVariable in m_nodelist)
                 {
                     m_node = m_node_loopVariable;
  
                     string Productcode = m_node.ChildNodes.Item(0).InnerText;
                     string productprice = m_node.ChildNodes.Item(1).InnerText;
  
                     Console.Write(" Product Code: " + Productcode  + "Product Price:" + productprice);
  
                     decimal strprice =Convert.ToDecimal( productprice);
                     decimal strtextprice = Convert.ToDecimal(textBox1.Text);
  
                     decimal test = strprice + (strprice * strtextprice/100);
  
                     string updatedprice = test.ToString();
  
                     UpdateProduct(updatedprice, Productcode);
  
                     XmlDocument readDoc = new XmlDocument();
                     readDoc.Load("C:\\Users\\pooja.b.EDREAMZ\\Desktop\\s&amp;p\\Final1.xml");
                     int count = readDoc.SelectNodes("/xmldata/Products").Count;
  
                     progressBar1.Minimum = 1;
                     // Set Maximum to the total number of Users created.
                     progressBar1.Maximum = count;
                     // Set the initial value of the ProgressBar.
                     progressBar1.Step = 1;
  
                     progressBar1.PerformStep();
  
                     // Updates the label to show that a file was read.
                     label2.Text = Convert.ToString(progressBar1.Value) + "updated of " + count;
              }
          } 
              catch (Exception ex)
              {
                  MessageBox.Show("Error updating product " + ex.Message);
              }
              this.Close();
              System.Windows.Forms.MessageBox.Show("Complete!");
          }
  
          private void UpdateProduct(string price, string Productcode)
          {
              xmldata1 data = new xmldata1();
              data.Items = new xmldataProducts[1];
              data.Items[0] = new xmldataProducts();
  
              data.Items[0].ProductPrice = price;
              data.Items[0].ProductCode = Productcode;
  
              string productXML = Utils.GetProductXML(data);
              string APIURL = Utils.GetAPIPostURL(ImportMode.Update);
  
              XMLPostManager manager = new XMLPostManager();
  
              string response = manager.SendXMLToURL(APIURL, productXML);
          }
      }
  }
  </code></pre>
  
  <p>Please advise.</p>