2017-05-13 1 views
0

VS 2010 및 SQL Server 2008 데이터베이스와 함께 .net 응용 프로그램을 만들었습니다.데이터베이스를 열 수 없습니다. .NET 응용 프로그램을 설치하는 동안 SQL Server 데이터베이스를 만들 때 사용자 오류로 로그인하지 못했습니다.

가 login.the 로그인에 의해 요청되지 데이터베이스 "PharmacyDb는"실패 수 : 이 http://techbrij.com/install-sql-server-database-with-visual-studio-setup

는하지만 응용 프로그램을 설치할 때마다, 나는 예외를 얻을 :이 링크의 지침에 따라 응용 프로그램을 배포 . . 로그인

내가 관리자로 설치를 실행 및 Windows 방화벽을 통해 SQL 서버를 허용하려고 '바하-PC \ 바하 "사용자 실패하지만, 난 여전히이 예외가

참고 :. 나는 3 SQL 스크립트를 파일을 내 데이터베이스를 생성하고, 내가 VS 또는 SQL Server Management Studio에서이를 실행할 때, 그들은 완벽하게 데이터베이스를 생성

을 내가

주 2 놓친 무엇을 가지고 :.?을이 install.cs 클래스의 연결 문자열입니다 :

(210)
string connStr = "Data Source=" + serverName + ";Initial Catalog=" + dbName + ";Integrated Security=True"; 

업데이트 : 로그 파일 : 나는 문제가 내가 설치 클래스의 데이터베이스에 연결이 필요 객체를 사용하는 것이 알았다 많은 시도 후

2017-05-13 13:13:17.60 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 13:13:17.60 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 13:23:10.03 spid52  Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required. 
 
2017-05-13 13:23:10.10 spid52  Using 'xpstar.dll' version '2009.100.1600' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required. 
 
2017-05-13 13:24:34.49 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 13:24:34.49 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 13:35:12.71 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 13:35:12.71 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 13:36:55.95 spid53  Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required. 
 
2017-05-13 13:36:55.99 spid53  Using 'xplog70.dll' version '2009.100.1600' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required. 
 
2017-05-13 14:03:27.26 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 14:03:27.26 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 14:07:27.27 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 14:07:27.27 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 14:07:56.66 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 14:07:56.66 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-13 14:11:45.57 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-13 14:11:45.57 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 
 
2017-05-14 00:37:36.40 Server  Server resumed execution after being idle 35916 seconds: user activity awakened the server. This is an informational message only. No user action is required. 
 
2017-05-14 00:37:41.48 Logon  Error: 18456, Severity: 14, State: 38. 
 
2017-05-14 00:37:41.48 Logon  Login failed for user 'Bahaa-PC\Bahaa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]

+0

SQL Server 오류 로그를 확인하십시오. 로그인에 실패한 구체적인 이유가있는 메시지가 있어야합니다. –

+0

동일한 상자에 sql 서버가 있습니까? Windows 인증을 사용하려고하므로 Bahaa-PC \ Bahaa가 SQL 서버에 액세스 할 수 있어야합니다. DB가 다른 경우 SQL 인증을 사용하고 연결 문자열을 변경하십시오. – NMK

+0

@Dan : 로그에 비정상적인 정보가 없습니다 –

답변

0

그래서 나는 그것을 제거했다.

관련 문제