我在下拉列表控件上收到以下错误:
An error occurred while executing the command definition. See the inner exception for details.
以下是崩溃的视图代码:
@Html.DropDownList("PackageId", null, htmlAttributes: new { @class = "form-control" })
这是控制器代码,我在其中获取下拉列表的数据:
ViewBag.PackageId = new SelectList(db.Packages, "u_package_id", "package_nme");
这是包控制器,以防需要:
public class Package
{
[Key]
public int u_package_id { get; set; }
public string package_type_cd { get; set; }
public string package_nme { get; set; }
public string status { get; set; }
public string modify_user_id { get; set;}
public DateTime modify_dt { get; set; }
public string package_category { get; set; }
public string i_package_nme { get; set; }
public Guid msrepl_tran_version { get; set; }
public string InvoicePackageName { get; set; }
public DateTime CreateDate { get; set; }
public DateTime LastModifyDate { get; set; }
public string invoice_package_nme { get; set; }
public Boolean InSTCUSAFlag { get; set; }
public string InSTCUSADisplayedName { get; set; }
public string InSTCUSADisplayedDescription { get; set; }
public Boolean PrerequisiteFlag { get; set; }
public Guid PrerequisiteID { get; set; }
}
}