我使用ASP.NET和Entity Framework C#在网上购物Web应用程序的工作。问题是,我的应用程序运行正常,当我测试了我的本地ASP.NET开发服务器上,但是当我主办的网站,它提供了以下错误:应用程序中的服务器错误。无效的对象名称dbo.Categories“
Server Error in '/samarth' Application. Invalid object name 'dbo.Categories'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'dbo.Categories'.
有什么不对的连接字符串?
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="CommerceEntities" connectionString="metadata=res://*/Data_Access.EDM_Commerce.csdl|res://*/Data_Access.EDM_Commerce.ssdl|res://*/Data_Access.EDM_Commerce.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Commerce.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/>
</connectionStrings>
得到这个错误:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
你问“连接字符串是否有问题? - 但你没有显示它! –
查看[this](http://aspspider.info/samarth/)进行演示。 –
这是一个非常明确的错误:“无效的对象名'dbo.Categories'。”您的权限错误,您指向错误的数据库,并且您没有正确部署目标数据库。修理它。 –