Automatic Refresh DataSet - Windows From C#

  • Thread starter Thread starter dnielo90
  • Start date Start date
D

dnielo90

Guest
Hi all,

im very noob with C# and visual studio and im trying to create a windows form that pick data from an SQL database and show it. The problem is that my database receives continually data from another program and i want to see the newest possible data. This is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IEEE34
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the dataSet1.TimeSeriesMeasurement table. You can move, or remove it, as needed.
this.timeSeriesMeasurementTableAdapter.Fill(this.dataSet1.TimeSeriesMeasurement);

timer1.Interval = 10000; // time in milliseconds
timer1.Start();
}


private void timeSeriesMeasurementBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
Validate();
timeSeriesMeasurementBindingSource.EndEdit();
tableAdapterManager.UpdateAll(dataSet1);
}

private void timer1_Tick(object sender, EventArgs e)
{


}
}
}


I Know that i have to insert something in the timer1_Tick event but dont know what.

Anyone can help me pleae?

Thank you.

Continue reading...
 
Back
Top