when i made this program i made users selecting the instance
When i execute this query on ssms there is no problem it shows every database but when i use c# to do it it only shows system databases
Debugging time, I guess!
First add this query to your C# program:
SELECT @@servername
to verify that you are connecting to the server you think you are connecting to.
Would that be the case, then add this query:
SELECT SYSTEM_USER, * FROM sys.fn_my_permissions(NULL, NULL)
Do you see VIEW ANY DATABASE in the list? Is the user the expected one?