Hi
I need to have my c# code to update from microsoft access automatically. can i use the timer control?
This is the code i found for timer control:
public partial class Form1 : Form
{
Timer timer = new Timer();
Label label = new Label();
public Form1()
{
InitializeComponent();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = (1000) * (5);
timer.Enabled = true;
timer.Start();
label.Location = new Point(100, 100);
label.AutoSize = true;
label.Text = String.Empty;
this.Controls.Add(label);
}
private void Form1_Load(object sender, EventArgs e)
{
}
void timer_Tick(object sender, EventArgs e)
{
label.Text = DateTime.Now.ToString();
}
}
These just give me a textbox with the time clicking.
Can someone pls advise how can i use these to make my program update automatically?
Thanks