MS SQL 데이터베이스를 사용하는 C# Windows 응용 프로그램 (2.0 프레임 워크)을 만들었습니다.
개발하는 동안 MS Visual Studio 2010 및 SQL 2008 MANAGEMENT STUDIO를 사용했습니다. 개발하는 동안
내 연결 문자열은 다음과 같습니다C# Windows 응용 프로그램에서 MS SQL SERVER 2008 R2 EXPRESS를 사용합니까?
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=SL;Integrated Security=True");
모든 것이 잘 작동 ....
가 지금은 클라이언트 시스템에서이 응용 프로그램을 실행합니다.그래서 클라이언트 시스템에 MS SQL SERVER 2008 EXPRESS가 성공적으로 설치되었습니다.
내 시스템의 SQL 서비스를 중지하고 내 컴퓨터에서 .mdf 및 .ldf 파일을 복사하고 클라이언트의 "c : \ Database \"에 붙여 넣었습니다. 그러나 달리면서 문제가 발생합니다. 내가 여러 번 시도했습니다
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)
연결 문자열은 다음과 같습니다 내가 연결 문자열에 User ID=sa;Password=pass
사용하는 경우
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS;Initial Catalog=SL;Integrated Security=True");
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS;Initial Catalog=SL;Persist Security Info=True;User ID=sa;Password=pass");
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS; AttachDbFilename =C:\\Database\\SL.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
내가 얻을 :
authentication failed for 'sa'
내가 몇 가지 단계를 없거나 뭐하는 거지 잘못된? 제 시스템에서 데이터베이스를 복사 한 후 어떻게해야합니까? C#에서 내 연결 문자열은 어떻게되어야합니까?
감사합니다.
예 ... 예 MSSQLEXPRESS. –