【发布时间】:2019-01-28 14:03:47
【问题描述】:
我正在尝试使用 Azure 的数据库发布我的 Web 应用程序,但我遇到了这个错误:
Invalid object name 'dbo.Employee'.
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.Employee'.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
这是我的连接字符串:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-HolidayTracker-20190122013056.mdf;Initial Catalog=aspnet-HolidayTracker-20190122013056;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="LotusWorksEntities" connectionString="metadata=res://*/Models.HolidayTrackerModel.csdl|res://*/Models.HolidayTrackerModel.ssdl|res://*/Models.HolidayTrackerModel.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-LAKNQGQ\CONORSQL;initial catalog=LotusWorks;user id=sa;password={"mypassword"};MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
我不确定我在发布时是否正确使用了这些,因为这是我的第一个网络应用程序。它确实已发布,但每当我使用使用数据库的页面时,我都会收到错误消息。
【问题讨论】:
-
你使用什么数据库? Azure SQL 还是本地 SQL?
-
我正在使用本地 SQL
标签: asp.net-mvc azure deployment azure-web-app-service publish