2016-08-11 23 views
0

我有我的xamarin的Android項目的ConnectionString:有問題的ConnectionString,國家關閉和打開

`<add name="NewsPushEntities" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=ROONEY;Initial Catalog=NewsPush;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework&quot;" providerName="System.Data.EntityClient" />` 

當我第一次打開我的項目,我得到的狀態關閉。

enter image description here

但是,當我點擊展開服務器資源管理器連接它變綠:

enter image description here

然而,當我試圖通過調用說的ConnectionString獲取在我的應用程序的東西它返回emptyhanded(這是一個休息服務返回一個JSON格式的菜單,它適用於當我連接到現場服務器,但不是我的本地服務器。)

connecti對住服務器:

<add name="NewsPushEntities" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;data source=removed;initial catalog=NewsPush;persist security info=True;user id=removed;password=removed;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 

最後但並非最不重要的,當我的狀態爲開(擴大我的連接後,它變成綠色)我得到以下特性:

enter image description here

難道我燒掉了不知怎的,連接字符串?不知道如何得到這個迴應。謝謝!

+0

你的空手是什麼意思?沒有錯誤? –

+0

我得到System.Net.WebException:錯誤:ConnectFailure(連接被拒絕)---> System.Net.Sockets.SocketException:連接被拒絕 – darrrrUC

+0

嘗試使用另一個工具相同的連接字符串。它肯定不會工作,表明連接可能有問題,例如,端口不打開或不管。我認爲你的網絡管理人員將能夠提供幫助。如果您沒有這些,請在服務器的事件查看器中檢查應用程序日誌。 –

回答

1

如果您沒有收到任何錯誤,請在您的本地計算機上調試您的服務,並使用監視窗口確定您的連接字符串是否設置正確。