0

このリンクを使用してアプリケーションを開発しています:

http://www.binaryintellect.net/articles/9a5fe277-6e7e-43e5-8408-a28ff5be7801.aspx

BasicDetails へのビューの生成中に、次のエラーが発生しました。

Unable to retrieve metadata for WebApplication.Models.BasicInfo

ここに私の接続文字列があります:

<add name="CompanyEntity" connectionString="metadata=res://*/Models.Employee.csdl|res://*/Models.Employee.ssdl|res://*/Models.Employee.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=myservername;initial catalog=Company;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

このアプリケーションを MVC5 で作成しています。

私の BasicInfo クラス:

public class BasicInfo
{
    public string EmpName { get; set; }
    public string CompName { get; set; }
}

EmployeeController クラスの私の BasicInfo:

public ActionResult BasicInfo(BasicInfo Details, string BtnPrevious, string BtnNext)
    {
        if (BtnNext != null)
        {
            if (ModelState.IsValid)
            {
                Employee ObjEmp = GetEmployee();
                ObjEmp.EmployeeName = Details.EmpName;
                ObjEmp.CompanyName = Details.CompName;
                return View("AddressInfo");
            }
        }

        return View();
    }
4

1 に答える 1

0

アクションの結果が何をしているのかわかりませんが、エラーは接続文字列に問題があることを意味します。

于 2013-10-26T05:23:01.297 に答える