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

In your timer_Tick eventhandler, instead of updating the Text of a label, update your application or do anything else you like to do here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.