Q:

settting in code a timer to run prgram. 

I have an application which I am running using windows scheduler every 30 minutes, I also have a config file which is a datatable called config.   I am going through each of the rows, which has a schedule column and if the time is in the 30 minute window the program should run the whole program.  The time windows are 12:00:00 and 12:30:00 and so on, as can be seen I'm checking the current time and the row time as can be seen blow, how  would I make it run? 
I tried the if statement below to see if it runs are the current time only and it doesn't work any ideas why this would be 
TimeSpan time = DateTime. Now. TimeOfDay;

TimeSpan runningTime = DateTime. Parse(dr["scheduledTime"].ToString()).TimeOfDay;

if (time == runningTime)

A:

If the time isn't exactly on the hour or half past the hour, the code in your if statement won't run, try this instead:
TimeSpan time = DateTime. Now. TimeOfDay;

TimeSpan runningTime = DateTime. Parse(dr["scheduledTime"].ToString()).TimeOfDay;

if (time >= runningTime && time <= (runningTime + new TimeSpan(0, 30, 0)))

When your program runs, DateTime. Now. TimeOfDay will contain something similar to 13:27:37, which obviously won't be equal to 13:00:00.  So all you do is check that the current time is within the 30 minute window.  We achieve that by checking that the current time elapsed since midnight (which is what .TimeOfDay on a DateTime gives you) is greater than or equal to the time elapsed since midnight of the TimeSpan you retrieve from your DataTable, and that it is also less than or equal to that same time slot plus 30 minutes.