我设置了一个数据库镜像,然后用它connectionstring
来连接它:
Data Source={0};Failover Partner={1};Initial Catalog=AdventureWorks;
Integrated Security=True;
将一些数据添加到数据库后,我关闭了主体服务器,因此镜像服务器成为主体服务器。我再次打开连接,收到此错误:
System.Data.SqlClient.SqlException: A transport-level error has
occurred when sending the request to the server. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.)
我认为通过在连接字符串中指定故障转移伙伴,ADO.NET 会为我完成这项工作。那我现在该怎么办?