0

我收到錯誤:無法獲取新的服務器錨

Unable to obtain a new server anchor. Make sure that you can establish a connection to the server database and that the SelectNewAnchorCommand property of the DbServerSyncProvider is specified correctly.

,而在這條線,在Windows Mobile同步SQL Server數據庫與緊湊型DB,就會出現此:

Dim syncStats As Microsoft.Synchronization.Data.SyncStatistics = syncAgent.Synchronize() 
+0

你在連接什麼?雙方(你的設備和你的服務器)是否支持同步? – jp2code

+0

我在Visual Studio 2008中創建了一個智能設備項目。我使用設計器嚮導在SQL Server DB(存在於其他計算機中)和Compact DB(存在於當前應用程序中)之間創建同步。嚮導使用WCF服務庫與服務器DB交互。當我更改WCF的app.config中的連接字符串時,發生了以下錯誤。 – vandana2011it

+0

如果你不改變連接字符串,它會工作嗎?如果您使用Windows集成安全性連接到您的SQL服務器,在哪個帳戶下運行wcf服務? – JuneT

回答

0

我的問題已經整理出來。我沒有使用SQL 2008,並且我的複製壓縮數據庫是從SQL Server 2008創建的。所以Dbs的架構不正確。 現在,在SQL服務器和壓縮數據庫之間完成同步。

0

I have made one smart device project in Visual Studio 2008.I used designer wizard to create synchronization between SQL Server DB(present in other computer) and Compact DB(present in the current application) . Wizard used WCF service library to interact with the server DB.Above error occurs when i change the connection string in the app.config of WCF.

跳到我的第一件事是該設備無法連接到您的服務器數據庫。無論您的連接字符串是否使用集成安全包含SQL用戶名和密碼如果設備本身未被授權建立與服務器的連接,則無關緊要。

使用這個不同的連接字符串,你可以直接連接到服務器(不使用同步)嗎?

例子:

Private Function DatabaseConnect(ByVal connection As String) As DateTime 
    Dim dateTime As DateTime = New DateTime(1900, 1, 1) 
    Dim obj As New Object() 
    Using cmd As New SqlCommand("SELECT GETDATE();", New SqlConnection(connection)) 
    cmd.Connection.Open() 
    obj = cmd.ExecuteScalar() 
    End Using 
    If (Not obj Is DBNull.Value) Then 
    dateTime = DirectCast(obj, DateTime) 
    End If 
    Return dateTime 
End Function 

另一件事來看看:是否要連接到支持同步此其他數據庫?這裏有多個數據庫,包括一個較老的SQL 2000數據庫。它不支持同步。

嘗試簡化您的項目以縮小發生錯誤的位置。

當前,使用嚮導,同步和WCF時有太多未知因素。

+0

謝謝你解釋我的事情。我的問題已經解決。我沒有使用SQL 2008,而我的複製壓縮數據庫是從SQL Server 2008創建的。所以Dbs的架構不正確。 – vandana2011it

+0

太好了。將其標記爲答案,以便閱讀此內容的其他人可以理解要嘗試的內容。 – jp2code