我的连接字符串有什么问题? 我将文件从一台计算机复制到另一台。然后我改变了我的连接字符串,因为我从另一台计算机移动了我的文件,它没有连接到数据库。当我尝试连接到SQL Management Studio时,它成功连接到我的服务器,当我尝试运行我的代码时,它没有。数据库连接:Web.config Asp.net
这里是我的连接字符串:(Web.config文件) - 我的服务器是Windows身份验证
<add name="ConnectionStringMe" connectionString="Data Source=ZOZOW-PC\MSSQLEXPRESS;Database=sample_db;Persist Security Info = True" providerName="System.Data.SqlClient" />
它给我的错误:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
是否有冲突,如果我的数据库是SQL 服务器身份验证然后我将它移动到Windows身份验证?
谢谢。
如果你使用Windows身份验证而不是SQL身份验证去,那么你将需要线“集成安全性=真”,你必须确保你的SQL数据库中添加了具有正确权限的用户。另外...你可以ping'ZOZOW-PC'...错误说“服务器找不到”... – beeker
为了将来的参考 - 当我有关于连接字符串的问题时,我总是喜欢看:http:// connectionstrings。 com/ – confusedandamused
@beeker我不知道如何ping。教我。谢谢 – EnzoZow