2012-10-22 3 views
2

확장명이 .mdf 인 데이터베이스에 연결해야하는 다른 사람이 만든 소프트웨어를 사용했습니다.오류 26이 데이터베이스에 연결할 수 없습니다.

그러나 소프트웨어를 실행할 때 error 26이 있습니다. 분명히 Google을 확인한 결과 주요 문제는 방화벽 인 것 같습니다. 하지만 문제를 해결하지 않으면 문제가 사라지지 않습니다. 나는 그것이 같은 error 26으로도 실패 데이터 컨텍스트 클래스와 데이터베이스를 연결하려고 할 때,

DataClasses1DataContext db = new DataClasses1DataContext(Environment.CurrentDirectory + "\\bddgestionvin.mdf"); 

는 내가 눈치 챘 : 데이터베이스 연결을 위해 여기

는 코드입니다.

이 클래스에서 사용하는 문자열 연결은 (아래 첨부 된 스크린 샷 참조) : 내가 좀 모호 해요 알고 있지만 나는 그런 종류의 물건을 결코하지 않았다

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bddgestionvin.mdf;Integrated Security=True;Connect `Timeout=30;User Instance=True` 

(A의 .mdf 데이터베이스에 연결) 그리고 코드는 제 것이 아니며, 더 자세한 설명/코드를 물어보십시오. 어떤 도움도 환영합니다!

P.S는 오류 메시지 (프랑스 소프트웨어에 대한 죄송합니다)

SqlException was unhandled 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)

enter image description here

+0

가능한 중복 : 26- 찾는 서버/인스턴스 지정 오류)] (http://stackoverflow.com/questions/6466974/unable-to-connect-to-sql-express-error-26-error-locating-server-instance-speci) –

+0

은 bddgestionvin입니다. .mdf가 실행 app 디렉토리에 있습니까? sql 연결은 app 디렉토리에 mdf 파일을 자동으로 첨부합니다. –

+0

예, 그는 bin/debug 폴더에 있습니다. 그리고 예 많은 주제가 있다는 것을 알고 있지만 아무도 저에게 도움이되지 않았습니다. 이것이 새로운 주제를 열어 놓은 이유입니다. – Edelweiss

답변

1

안녕하세요 난 당신이 다음 단계를 볼 수 있습니다 몰라. 이러한 단계가 통과해야합니다. 을 설정하는 동안

The reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It's easy to isolate the issue. Here are the steps:

1) Make sure your server name is correct, e.g., no typo on the name.

2) Make sure your instance name is correct and there is actually such an instance on your target machine. [Update: Some application converts \ to . If you are not sure about your application, please try both Server\Instance and Server\Instance in your connection string]

3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).

4) Make sure SQL Browser service is running on the server.

5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.

당신은 또한 SQL 브라우저 UDP 패킷을

을 차단하지 않습니다 PortQry을 시도하고 방화벽을 확인할 수 here

에서 자세한 내용을보실 수 있습니다 네트워크 관련 또는 인스턴스 관련 오류가 발생했습니다 SQL Server에 연결. Failed to establish a connection with SQL Server.

서버를 찾을 수 없거나 액세스 할 수 없습니다. May be server is stopped, you don't have permission to access the server, or the instance name is not correct .

인스턴스 이름이 올바른지, SQL Server가 원격 연결을 허용하도록 구성되었는지 확인하십시오.

Please goto SSMS and try connecting the server. Verify the SQL Server is running and your account is configured to access the service.

(공급자 : SQL 네트워크 인터페이스 오류 : 26 - 오류 지정된 서버/인스턴스 찾기)

감사를

[SQL Express에 연결할 수 없습니다 "오류의
+0

로컬 저장된 데이터베이스에서이 소프트웨어를 실행하고 있는데 DNS/서버 단계를 모두 확인해야합니까? 그 이미지에서 – Edelweiss

+0

나는 당신이 './SQLEXPRESS'를 사용하고있는 것을 볼 수 있습니다. 일반적으로 서버는 localhost이고 인스턴스 이름은 SQLEXPRESS입니다. SSMS를 사용하여 SQL Server에 연결할 수 있습니까? – kbvishnu

+0

SSMS를 사용하여 연결할 수 있는지 잘 모르겠다. 내가 살펴보고 이에 대한 소식을 전하겠습니다. – Edelweiss

관련 문제