我有 3 个文本框,第一个是数量,第二个是价格,第三个是总价。
<div class="form-group">
@Html.LabelFor(model => model.quantity, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.quantity, new { htmlAttributes = new { @class = "form-control", @type = "number" } })
@Html.ValidationMessageFor(model => model.quantity, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.price, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.price, new { htmlAttributes = new { @class = "form-control", @type = "number" } })
@Html.ValidationMessageFor(model …Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用代码优先方法。但是,当我尝试使用“update-database”命令运行 db-migrations 时,出现空引用异常,当我运行应用程序时,出现以下配置错误: Authentication to host 'localhost' for user 'root'使用方法“mysql_native_password”失败并显示消息:未知数据库“xxx”。
这是连接字符串:
<add name="DefaultConnectionString" connectionString="server=localhost;port=3306;Database=cps;uid=root;pwd=root;" providerName="MySql.Data.MySqlClient" />
Run Code Online (Sandbox Code Playgroud)
PS:在其他系统上运行良好。