At least one reader has encountered a problem with the Table-Valued Function (TVF) example in Chapter 10 of Microsoft ADO.NET Entity Framework Step by Step when working with Visual Studio 2013. Before you begin this example, make absolutely certain that you have setup and configured SQL Server for use with the book. You can find the required instructions in these posts:
In addition, you must start the SQL Server Browser. Otherwise, the example will never work.
First, the good news—the example does in fact run. If you use the downloadable source code, rather than trying to type the example in by hand, you can see it function and work through the example using any technique you like (such as the debugger). However, as I pointed out in Entity Framework Examples – Visual Studio 2013 Update, this book really is designed to work best with Visual Studio 2012, so it’s not unexpected that you may encounter problems if you don’t follow the guidelines in the System Requirements section of the Introduction (page xxii).
The bad news really isn’t that bad. You may see an error, “Error 3027: No mapping specified for the following EntitySet/AssociationSet – ObtainClientsEntities” when you compile the example. The example will still work, but the error message is disconcerting. Unfortunately, I haven’t been able to reproduce it on my system using Visual Studio 2012. You may be able to rid yourself of this error message by erasing the .suo files in the example file and doing a complete rebuild of the example.
In addition, when you open the Rewards2Model.edmx file in the XML editor, you may see “Error 11007: Entity type ‘ObtainClientsEntity’ is not mapped.” Again, I haven’t been able to reproduce this error. There is some discussion that you really must create the table before creating the example application in order to avoid this error. However, taking that step would reduce the usefulness of the technique. Again, the example works just fine even with this error in place.
What is need to know is whether these two errors are common and what I need to do to reproduce them. It may be that there is a quick fix that has so far eluded notice. In the meantime, it’s safe to ignore the two errors because the example does run, even when you’re working with Visual Studio 2013. Please contact me with your findings at John@JohnMuellerBooks.com.