[英]Server Error in '/' Application. The provider did not return a ProviderManifestToken string.
我已經尋找了一段時間,在這部分代碼中仍然遇到相同的錯誤:
public ViewResult List(string category, int page = 1)
{
ProductsListViewModel viewModel = new ProductsListViewModel
{
Products = repository.Products
.Where(p => category == null ? true : p.Category == category)
.OrderBy(p => p.ProductID)
.Skip((page - 1) * PageSize)
.Take(PageSize),
PagingInfo = new PagingInfo
{
CurrentPage = page,
ItemsPerPage = PageSize,
TotalItems = category == null ?
repository.Products.Count() :
repository.Products.Where(e => e.Category == category).Count()
},
CurrentCategory = category
};
return View(viewModel);
}
我附上了網絡配置代碼:
<configuration>
<connectionStrings>
<add name="SportsStore" connectionString="Data Source=ASUS-ПК;Initial Catalog=SportsStore;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
和app.config代碼:
<connectionStrings>
<add name="SportsStoreEntities" connectionString="metadata=res://*/Concrete.ORM.SportsStore.csdl|res://*/Concrete.ORM.SportsStore.ssdl|res://*/Concrete.ORM.SportsStore.msl;provider=System.Data.SqlClient;provider connection string="Data Source=ASUS-ПК;Initial Catalog=SportsStore;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
請告訴我我做錯了什么?
似乎您的連接字符串之一是錯誤的。
獲取有效連接字符串的最安全方法之一是在Visual Studio中連接到數據庫,然后右鍵單擊工作連接,選擇“屬性”,然后將顯示的“連接字符串”值復制到存儲庫設置為的配置文件中采用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.