SQL server Error 4060

User credentials are ok, but user doesn't have the right to connect to the given database, you should grant him all rights needed...


Do you have permission to access the database using the credentials that you are supplying? What provider are you trying to use? TCP/IP, Named Pipes? Has that provider been enabled? Is there a firewall in place and have you opened up the port to the client? Does this happen intermittently? If so, do you have enough licenses available when the error occurs? You might want to check the server error logs (and your client event log, too) for more information.


This error also occurs if the Database not exists

so make sure that there is a database with the name you provided in Catalog=MyDB