Uchenna

SqlException: Invalid column name 'TotalViews'.

net Icon

Microsoft.Data.SqlClient.SqlException

Invalid column name 'TotalViews'.

An unhandled exception occurred on line 146
143
                                    Karma
144
                                </h5>
145
146
                                @if (Model.User.Aggregates.TotalRewards > 0)
147
                                {
148
                                    <h4 class="mb-0 text-success font-size-h4-sm">

Solution

I added new fields to my entity and didn't run the migrations. Ensure migrations have been created using the Add-Migration and ensure they are ran using the Update-Migration commands.            
Mar 28, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your .NET errors.

Chrome logo Add to Chrome - It's free