none
SyncFx 1.0 sp1 throw FormatException when sync image column. RRS feed

  • Question

  • HI,

    We have a sync solution which us SyncFx 1.0 sp1 to sync data between sqlserver 2008 and SqlCe 3.5 sp2 on Mobile device (Dev Machine use WIN7 SP1). The solution works well until recently we add an image column to our database table. The mobile device throw the FormatException as followings:  

    at System.Convert.FromBase64CharArrayHelper(Char* pCharArray, Int32 offset, Int32 length)

       at System.Convert.FromBase64String(String s)

       at System.Data.Common.ObjectStorage.ConvertXmlToObject(String s)

       at System.Data.DataColumn.ConvertXmlToObject(String s)

       at System.Data.XmlDataLoader.LoadColumn(DataColumn column, Object[] foundColumns)

       at System.Data.XmlDataLoader.LoadTable(DataTable table, Boolean isNested)

       at System.Data.XmlDataLoader.LoadData(XmlReader reader)

       at System.Data.DataSet.ReadXmlDiffgram(XmlReader reader)

       at System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)

       at System.Data.DataSet.ReadXmlSerializable(XmlReader reader)

       at System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader reader)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeSerializableElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)

       at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)

       at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)

       at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)

       at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)

       at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)

       at System.Xml.Serialization.XmlSerializationReader.DeserializeElement(Accessor accessor, Fixup fixup)

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)

       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)

       at Microsoft.Tools.ServiceModel.CFClientBase`1.CFContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)

       at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)

       at System.ServiceModel.Channels.Message.GetBody[T](XmlObjectSerializer serializer)

       at Microsoft.Tools.ServiceModel.CFClientBase`1.getResult[TRESPONSE](Message reply, CFInvokeInfo info)

       at Microsoft.Tools.ServiceModel.CFClientBase`1.Invoke[TREQUEST,TRESPONSE](CFInvokeInfo info, GetChangesRequest request)

       at LocalDataCache1SyncContractClient.GetChanges(GetChangesRequest request)

       at LocalDataCache1SyncContractClient.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)

       at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)

       at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)

       at Microsoft.Synchronization.Data.ServerSyncProviderProxy.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)

       at Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)

       at Microsoft.Synchronization.SyncAgent.Synchronize()

       at SyncTest.Form1.Sync()

       at SyncTest.Form1.menuItem1_Click(Object sender, EventArgs e)

       at System.Windows.Forms.MenuItem.OnClick(EventArgs e)

       at System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)

       at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)

       at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

       at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)

       at System.Windows.Forms.Application.Run(Form fm)

       at SyncTest.Program.Main()

    Does anyone seem the same error before? Can you give me any hint to get rid of this?
    -----latest update------------------
    It seems that not all the image fields have error, just some of them, still try to find out the cause of the exception.
    failed record: 0x, success: NULL. success:0x1234

    It seems that the data in the database table image field will cause the sync to fail.

    Is there any way to work around?

    Saturday, March 12, 2011 10:57 AM