0

I am using c# winforms-MySql Server.

I have 12 values and in every hour I need to select one value from that 12 value list. Timer can easily select the number.

But the problem is I have 5 Terminal where the software is to be installed. They all will select a value from the list. The value can be same or different. But I need the select same value for all the terminal. I don't have any client-server facility because any terminal can be open or closed at any time.

Can MySql select a value from a list in every hour without any c# code? Any concept will be helpful. I don't need any code if you have a problem. Thanks

Sourav
  • 51
  • 8

1 Answers1

0

A solution can be:

  • Create a Table with only 1 Column and 1 Row. It will contain, in the single cell, the current synchronized value;
  • Create a Timer in mySql. You can get some useful infos here;
  • The Timer makes a Stored Procedure to run;
  • That Stored Procedure updates the synchronized value;
  • All the Terminals query the database looking for that value, whenever and however you want: they will always retrieve the a synchronized value.
Community
  • 1
  • 1
Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47
  • ts a perfect solution for the question I asked. But I need to start the event every day at 9:00 Am and stops at 9:56 PM. How can I achieve that? – Sourav Dec 16 '16 at 16:45
  • @Sourav the link I posted contains some answers that talk exactly about scheduling a database event at a certain date and time. – Massimiliano Kraus Dec 16 '16 at 17:33
  • @Sourav check [this](http://stackoverflow.com/questions/3070277/mysql-event-scheduler-on-a-specific-time-everyday) – Massimiliano Kraus Dec 16 '16 at 18:19