2011-04-30 3 views
0

An error occured while establishing a connection to the server. When connecting to the SQL server 2005, the failure may be caused by the fact that under the default settings SQL server does not allow remote connections. (provider: Named pipes provider, error: 40 - Could not open a connection to SQL server)오류 2005

내가 여기 실종 무엇 .NET 프레임 워크 SQL Server에 대한 제공 및 Visual Studio 2008

Data Source=.\SQLEXPRESS;AttachDbFilename="";Integrated Security=True;User Instance=True 

을 사용하고 SQL 서버에 연결하는 동안?

답변

1

나는 외부 참조 나쁜 알고 있지만, 정말이보다 더하지 않습니다 그들은

Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.mdf;Database=dbname; Trusted_Connection=Yes; 
+0

위대한 사이트이므로 자주 사용합니다. –

1

AttachDbFilename은 사용할 데이터베이스 경로 (일반적으로 .mdf) 여야합니다.

Data Source=.\SQLEXPRESS;AttachDbFilename=c:\some.mdf;Integrated Security=True;User Instance=True 
1

An error occured while establishing a connection to the server. When connecting to the SQL server 2005, the failure may be caused by the fact that under the default settings SQL server does not allow remote connections. (provider: Named pipes provider, error: 40 - Could not open a connection to SQL server)

기본 SQL 서버가 말한대로

http://www.connectionstrings.com/

Express는 TCP/IP 및 Named Pipe를 통한 원격 연결을 비활성화하므로 enab을 사용해야합니다. SQL Server 구성 관리자 (시작 -> 프로그램 -> Microsoft SQL Server 2008 -> 구성 도구)에서 이러한 프로토콜을 선택합니다.

enter image description here

는 또한 ConnectionStrings.com 좋은 사이트에 대해 호건에 동의!