描述:当前Web请求的执行期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中起源的更多信息。 异常详细信息:System.Data.SqlClient.SqlException:无效的列名“ Length”。
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
try
{
WebSecurity.CreateUserAndAccount(model.Username,model.Role, model.Password);//error
is here
WebSecurity.Login(model.Username, model.Password);
return RedirectToAction("Index", "Home");
}
catch (MembershipCreateUserException e)
{
ModelState.AddModelError("", ErrorCodeToString(e.StatusCode));
}
}