Afternoon (UTC +0) all
I am having a slight problem with the FileSystemWatcher.
The File watcher does exactly what i want it to do (as in throwing an event when needed).
However, when this event is thrown the debugger stops with no exceptions.
This has never happened to me before so i wondered if anyone could help me.
This is the function for creating the watcher:
private void CreateWatcher()
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = @"M:\CALL CENTRE\";
watcher.Filter = "*.accdb";
watcher.NotifyFilter = NotifyFilters.LastAccess;
watcher.Changed += new FileSystemEventHandler(watcher_Changed);
watcher.EnableRaisingEvents = true;
}
And this is the "watcher_Changed" event:
private void watcher_Changed(object sender, FileSystemEventArgs e)
{
try
{
sup.ForeColor = Color.SteelBlue;
sup.Text = "Updating...";
sadset.Clear();
admin.Fill(sadset.Tables["Solicminor"]);
adlqu.Fill(sadset.Tables["Soliclqu"]);
adsol.Fill(sadset.Tables["Solic"]);
sup.ForeColor = Color.SeaGreen;
sup.Text = "Updated";
}
catch
{
sup.ForeColor = Color.MistyRose;
sup.Text = "Unable to update";
}
}
Thank you in advance