C# '中的服务器错误/';应用提供程序未返回ProviderManifestToken字符串。
我已经查找了一段时间,但在这部分代码中仍然出现相同的错误:C# '中的服务器错误/';应用提供程序未返回ProviderManifestToken字符串。,c#,asp.net,C#,Asp.net,我已经查找了一段时间,但在这部分代码中仍然出现相同的错误: public ViewResult List(string category, int page = 1) { ProductsListViewModel viewModel = new ProductsListViewModel { Products = repository.Products .Where(p => categor
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);
}
我正在附加web配置代码:
<configuration>
<connectionStrings>
<add name="SportsStore" connectionString="Data Source=ASUS-ПК;Initial Catalog=SportsStore;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
<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" />
和app.config代码:
<configuration>
<connectionStrings>
<add name="SportsStore" connectionString="Data Source=ASUS-ПК;Initial Catalog=SportsStore;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
<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" />
请告诉我我做错了什么?似乎您的一个连接字符串出错了 获取有效连接字符串的最安全方法之一是在VisualStudio中连接到数据库,然后右键单击工作连接,选择“属性”,并将显示的连接字符串值复制到存储库设置为使用的配置文件中