you can write your code in this way
dim sql as string= " SELECT DISTINCT UserID FROM tblUserInfo WHERE IsActive = 1"
this beacause your value is an integer and sql doesn't want ' for integer.
for debug your windows service you can use this tutorial, although you should use a windows application for testing your code (you can change a little of your code in debug mode).
<a href="https://www.youtube.com/watch?v=pfF-GNK5ygE">How to Debug Windows Service Source Code in Microsoft Visual Studio - YouTube</a>[<a href="https://www.youtube.com/watch?v=pfF-GNK5ygE" target="_blank" title="New Window">^</a>]
I hope it was useful