我創建了我的vb.net win應用程序的安裝程序,併成功將它安裝在另一臺電腦上。該數據庫文件也恢復在其他PC SQL服務器,但問題是,當我運行我的應用程序它不連接到SQL服務器,並引發錯誤已安裝的WinForm應用程序拋出錯誤「與SQL Server建立連接時發生網絡相關或實例特定錯誤」
一個網絡相關或實例特定的錯誤,同時建立一個連接到SQL服務器
我嘗試了很多,但它仍然沒有得到修復。所有的SQL Server實例正在運行,我已經檢查並重新啓動很多時間,但我想知道爲什麼會出現這個問題,因爲在我的主要PC這個應用程序運行得很好。 任何解決方案? 問候
更新// 端口已啓用其已經1433這是在app.config代碼:
<configuration>
<configSections>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="dbx" connectionString="Data Source=SERVER;Initial Catalog=DemoDb;User Id=sa;password=123456#"
providerName="System.Data.SqlClient" />
<add name="db.My.MySettings.MasterDemoConnectionString"
connectionString="Data Source=SERVER;Initial Catalog=Demo;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
在sql配置管理器中檢查協議是否啓用了TCP/IP。同時檢查sqlserver瀏覽器服務是否在安裝sql server的機器上運行。 – GuidoG