我正在尝试将我的 .net 网站部署到共享托管服务器。当 Entity Framework 尝试连接到数据库时,出现以下错误:
Server Error in '/' Application.
Login failed for user 'PHX3\Iusr_9086819'. 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: Login failed for user 'PHX3\Iusr_9086819'.
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.
Stack Trace:
[SqlException (0x80131904): Login failed for user 'PHX3\Iusr_9086819'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5061898
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
这是我的连接字符串,已删除敏感数据:
<add name="CoreEntities"
connectionString="
metadata=res://*/CoreModel.csdl|res://*/CoreModel.ssdl|res://*/CoreModel.msl;
provider=System.Data.SqlClient;
provider connection string='
Data Source=*****.db.*****.hostedresource.com;
Initial Catalog=kshoultz;
integrated security=True;
multipleactiveresultsets=True;
App=EntityFramework;
User ID=*****;
Password=*****;
Database=*****;
'"
providerName="System.Data.EntityClient" />
最佳答案
我认为集成安全性应该是 false - 这意味着不使用用户 ID 和密码。初始目录是数据库的名称 - 他们是否告诉您数据库名为 kshoultz? (可能是,我不知道有什么不同,但如果您创建了一个数据库并选择了一个名称,那就是您想要使用的名称)。密码中是否包含非字母/数字的字符?你必须对它们进行编码,例如你的密码是Love&Peace,你必须说Love&Peace
您是否寻求过 GoDaddy 支持?
关于entity-framework - Entity Framework 和连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9695023/