I was getting "Type 'TeamStats.TeamStatsDataTable' is not defined" and "Type 'TeamStatsTableAdapters.TeamStatsTableAdapter' is not defined" errors in my code.
In my case it was the datasets but it could be for any code file you have stored in the App_Code folder in a website project.
The App_Code folder isn't recognized as an ASP.NET folder in a web application project so you'll have to move the files from there into another location in your project.
I moved the *.xsd and *.xss dataset files into a new folder and then right-clicked on the folder in Visual Studio and selected "Include In Project" which generated the *.Designer.* files for the datasets.