The remote SQL server's clock should be in sync with the machine's clock where the program is run.
The sqlTrackingWorkflowInstance.WorkflowEvents fetches WorkFlowEvents in a DateTime range between SqlDateTime.MinValue and DateTime.UtcNow. If the SQL machines clock is ahead of the application machines clock then events will not be fetched until the application machine's clock catches up with the events DateTime creation time.
- Make sure your application server and Database server clock is in sync (you have to sync it to seconds also).
- make sure tracking service IsTransactional property set it to false
SqlTrackingService trackingservice = new SqlTrackingService(connectionString);
trackingservice.IsTransactional = false;