日期:2014-05-17  浏览次数:20939 次

新手求救:<VS2010 连接 SQL Server 2008 连接不上>
下面是我的一些基本设置,我截图放在下面:




此处用sa 和 密码登陆成功!





此处在VS2010中 tools - Database 连接数据库成功!


此处为防火墙设置!后来我防火墙直接不启用了!

SqlConnection conn = new SqlConnection("Data Source=192.168.10.128;Initial Catalog=Student;User ID=sa;Password=123456");   
            conn.Open(); 


最后连接时候报错: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)

请问高手我哪个环节漏了或者没设置...  先谢过大家啦!

------解决方案--------------------
继续google,原因很多的,服务器能ping通吗,1433端口telnet通吗
------解决方案--------------------
2处TCP的端口都改为1433试试