Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Automatic Refresh DataSet - Windows From C#

$
0
0

Hi all,

i'm very noob with C# and visual studio and i'm 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 don't know what. 

Anyone can help me pleae?

Thank you.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>