ASP.NETとEntityFrameworkc#を使用してオンラインショッピングWebアプリに取り組んでいます。問題は、ローカルのASP.NET開発サーバーでアプリケーションをテストするとアプリケーションが正常に実行されることですが、Webサイトをホストすると、次のエラーが発生します。
'/samarth'アプリケーションのサーバーエラー。オブジェクト名'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>
このエラーが発生しました:
指定された名前付き接続が構成に見つからないか、EntityClientプロバイダーでの使用を目的としていないか、無効です。