Connection Error:DB

When I was trying to connect to a database instance on the local machine using C#, I kept on getting an error. I tried everything, I opened up SQL logs to read what error was thrown on the server side (Which helps tremendously)  and it actually helped me to find a problem. The problem was the name of the database. I did not check thoroughly all the attributes of the connection string for connection. I just changed the name of the database in the connection and it worked. Hahahaha