I'm new to windows services and... you guessed it, Iâ€™m a bit stuck. Let me paint the picture â€“
Iâ€™m running a timed service that use an OdbcDataReader and SqlBulkCopy to (1) archive the data (2) normalize the data on a SQL box. When I run this code in a windows form proj. it works fine. Then, when I change the DNSâ€™s Data Directory Path to a local drive, instead of the network share (just simulated the environment locally), it works as well.
Iâ€™m obviously missing something. Any help will be appreciated.
When you run the windows form project it runs using your login account. The service runs using the LocalSystem account which probably does not have rights to access the network share specified in the ODBC settings.
You can check this by going into the Services Properties->Log On tab and make it run using your account. If it works then it probably was an access rights problem.
I would recommend creating a user account that just has enough access rights to access the share.