title: Timer to refresh charts in c#
body: <p>I have created a chart which receives its data from a SQL Server database. Whenever I save new data into the database, all the reports get updated, but the chart does not update until I exit the application and log in again. I decided to use Timer in C# to automatically refresh the chart every 5 seconds.</p>
  
  <pre><code>//this is to invoke the timer as soon as the application launches.
        public MDIParent2()
          {
              InitializeComponent();
              myTimer.Enabled = true;
              myTimer.Start();
          }
  //this is my timer event
  private void myTimer_Tick(object sender, EventArgs e)
          {
  
              this.Refresh();
              MessageBox.Show("Refreshed!");//this was added to determine if the timer is working
          }
  
  //this lets me stop the timer
  
  private void button1_Click(object sender, EventArgs e)
          {
              myTimer.Stop();
          }
  
  
  //this lets me resume the timer       
   private void button2_Click(object sender, EventArgs e)
          {
              myTimer.Start();
          }
  </code></pre>
  
  <p>I get the message "Refreshed!" every 5 seconds, but chart is still not refreshed. Can someone please assist?</p>