我在向表中添加列时遇到问题,这似乎很简单,所以我不明白为什么会出现此错误。要在 SQL 中添加列,我使用了以下查询:
ALTER TABLE [Trades]
ADD level nvarchar(max)
要添加到我添加的模型:
public string level { get; set; }
到公共阶级贸易。
可能是什么问题?
编辑:这是完整的错误:
Invalid column name 'level'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'level'.
Source Error:
Line 20: {
Line 21: ViewBag.Name = Name;
Line 22: return View(db.Movies.ToList());
Line 23: }
Line 24: