我有一個數據庫,名爲Library
,在我本地創建的服務器實例下創建於SQL Server 2014中。我在Windows窗體應用程序中使用該數據庫作爲數據源。這是完全工作時,我的電腦,但是當我在其他機器上運行它,它與使用C#應用程序對使用SQL Server 2014創建的數據庫進行遠程訪問Management Studio
Unhandled exception occurred...
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 connection to SQL Server)
我已經開始從配置管理器中的所有服務,並在協議已經啓用了TCP/IP協議爲MSSQLSERVER
錯誤停止。有什麼辦法可以做到這一點,還是我必須轉移到本地數據庫?
您能否詳細說明您所說的「配置字符串」?我的連接字符串是: 'Data Source = NILADRI-HP; Initial Catalog = BookLibrary; Integrated Security = True; Encrypt = False' – Nil 2014-10-12 11:54:16
您好無,我的意思是連接字符串,現在查找您的連接字符串,您正在使用您的Windows憑據可以訪問遠程數據庫,因此請確保使用您的Windows用戶名/密碼,您可以連接到NILADRI-HP,並通過SQL Management Studio完全訪問「BookLibrary」數據庫,如果您不需要連接例如在NILADRI機器上使用用戶名/密碼設置,具有對BookLibrary數據庫的讀/寫訪問權限。 – 2014-10-13 12:37:00