I'm working on an ASP.NET MVC application. I'm trying to use some SQL View objects (not SQL tables, not stored procedures) to fetch some data, but it isn't working at all. When I run the app to go to the index() method of on of the controllers to show the data, an error is thrown which says:
System.Data.Entity.Core.EntityCommandExecutionException was unhandled by user code HResult=-2146232004 Message=An error occurred while executing the command definition. See the inner exception for details. Source=EntityFramework
then later looking at the innerexception I've got this:
InnerException: System.Data.SqlClient.SqlException HResult=-2146232060 Message=Invalid column name 'HeardAboutID'. Source=.Net SqlClient Data Provider ErrorCode=-2146232060
This is wrong. I most certainly DO have a column named HeardAboutID in the SQL View. I've got a model class in my MVC project that has a column named HeardAboutID in it. So to say that HeardAboutID isn't there is patently false.
So this makes me wonder, does ASP.NET MVC 5 only work with SQL tables and stored procedures? Does it in fact NOT work with SQL Views?