簡體   English   中英

連接字符串無效

[英]Connection string not valid

我正在嘗試使用C#連接到SQL Server 2012數據庫,服務器和程序都在同一台計算機上。 當我嘗試連接時,出現異常:

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: 25 - Connection string is not valid)

有一個內部異常,只說{"The parameter is incorrect"}

我正在嘗試使用此連接

<add name="KBLEntities" connectionString="metadata=res://*/Models.KBL.csdl|res://*/Models.KBL.ssdl|res://*/Models.KBL.msl;provider=System.Data.SqlClient;provider connection string='data source=\sql8dvlp1\v01;initial catalog=KBL;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />

知道什么參數不正確嗎?

您是否還具有與數據庫窗口相同的憑據? 您是否嘗試使用集成的security = false並顯式提供用戶名和密碼?

你能以這種方式連接嗎?

另外,嘗試提供數據源作為數據源=“(本地)” https://msdn.microsoft.com/zh-cn/library/ms156450.aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM