EDIT Seems the forum editor is acting up with formatting with links so realize this and the links are all at the bottom of the post.
Take credentials from user to connect to that database.
Seems if this is a desktop solution using SqlDependency that there would be a user setup in the database or in active directory with proper permissions so no login is needed.
If any exception occurs then write that to a notepad file in that system.
There are many ways to achieve this from a log library to writing to application logs on the local machine or on a server, goes with proper permissions to perform writing to test or application logs
After the connection is OK then that program will check if any new data has arrived in 1 specific table.
This is the easy part yet considerations go to if a windows service what account is the service running under? local, system what are their permissions. A service does not run under the current user login.
If the data has just inserted in that table from any source then my service will call an External API and post that latest row data to that API.
Same as above.
What is better, both writing a service (if never done this before) is easy to write yet things like
Debugging locally or on a server can be challenging especially when testing on Windows version higher than Windows 7 as Microsoft changed security in Windows 8 on up. Controlling the service can get tedious so I use a utility (I created). Setting up for remote debugging, goes back to Microsoft's security and attaching to the service process in Visual Studio.
Working with SqlDependency
other than properly setting up the database is much easier to deal with, could be executed from Windows scheduler or run from a system try application. If needed a login can be done or go with setting up the user(s) permissions in SQL-Server.
My recommendation is to use SqlDependency
for your requirements and ease of coding.
References
For creating an Windows service installer Windows Service developer GUI for install while in development mode and source for article with a sample service, in this case writes records to SQL-Server but can also read etc.
Debugging a windows service under Windows 10