DbConnection连接失败,SqlConnection连接成功
DbProviderFactory dbFactory = DbProviderFactories.GetFactory(“System.Data.SqlClient”)
DbConnection dbConn = dbFactory.CreateConnection();
dbConn.ConnectionString = "Data Source=XXX\ooo;Initial Catalog=MyDb;User ID=jj;Password=yy;";
Open时出错:System.Data.SqlClient.SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
相同的连接字符串,使用SqlConnection连接就成功,哪位知道是什么原因?