Error Message Saying "Invalid Object Name" I have been following a SQL course for the past few weeks and I never have had this problem: my database is connected but I get the error message saying "Invalid Object Name". Please see picture.
Your SQL Query is in the wrong database. You are trying to select from the AdventureWorksLT2012 database, but you're connected to the Master database.

If you look at the top left of your window, you will see a bar at the bottom of the ribbon that contains a drop-down list. In it, you can see "master" is the current database. 

There are three ways to resolve this in your queries. After you do so, the red lines under your table and column names should all vanish, as they're warning you that the tables and columns don't exist in the current selected database.


Change the drop-down to the correct database. This will fix your query window for that window and that window only, but is the most common solution. 
Change your queries to reference the database. This would be queries like Select * from AdventureWorksLT2012.SalesLT.SalesOrderDetail for example. Setting the DB name in your query means it will no longer matter which database your current context is.
Start the query off with a USE [AdventureWorksLT2012]; Go; statement. This will switch your context to the correct database. After running the query, the screen will show this database in the drop down list I mentioned in option 1.