I have an ASP.NET MVC web app using Entity Framework. After deploying I decided to rename a column for consistency reasons. I fixed it in the EF model and the local database that the model is based on. Since publish to filesystem can't update the database, I fixed it by hand in the SQL Server Express database on the destination server.
But the web app gets an error saying "Invalid column name 'LastUpdateTime'." (which is what I renamed it to). I can see in SQL Server Express that the column is there and that is how it's spelled.
I copied the query from the web app log and ran it directly against the database. It worked but I was getting the red squiggly lines under LasUpdateTime. I found this stackexchange article sql server invalid object name - but tables are listed in SSMS tables list, and following the answer there, the red squiggly lines went away, but the web app still gets the error.
Here's the query as EF created it.
SELECT
[Extent1].[Id] AS [Id],
[Extent1].[Name] AS [Name],
[Extent1].[Description] AS [Description],
[Extent1].[IsPrivate] AS [IsPrivate],
[Extent1].[LastUpdateTime] AS [LastUpdateTime],
[Extent1].[ThumbnailPhoto_Id] AS [ThumbnailPhoto_Id]
FROM [dbo].[Groups] AS [Extent1]
ORDER BY [Extent1].[LastUpdateTime] DESC
When I run this in a query in SQL Server, it works just fine, but the web app fails.
Out of curiosity, I just tried renaming the Description column to "blah". The web app only complained about LastUpdateTime.
I suspected the Connection String was pointing to a copy of the original .mdb file, but it's pointing to the SQLEXPRESS server.
Any suggestions?