none
Unable to sync table to CE 3.5 SP1 in VS 2008 SP1 RRS feed

  • Question

  • I'm getting the message:

    Synchronizing the database failed with the message: 'SqlCeTableColumns.GetValueByColumnName'

    when trying to add a table in my local database cache object. The server is a WCF service library and the client Windows Mobile Professional 6. There are no peculiar field names in the table, it is well structured and has a primary key.

    Any advice appreciated.

    Monday, May 24, 2010 12:36 PM

All replies

  • can you post the exact exception message? or is it really just displaying 'SqlCeTableColumns.GetValueByColumnName'?
    Wednesday, May 26, 2010 11:07 AM
    Moderator
  • Afraid so, in a standard message box with caption 'Failed to sync database' and text 'Synchronizing the database failed with the message: 'SqlCeTableColumns.GetValueByColumnName''

    I've unable to to attach an image but it's happening after defining which tables to sync as it tries to populate the sdf with data for the first time. I thought it may have been due to a number of columns and tables having the string 'sys' in them but I'm unable to replicate this consistently. I'm at a bit of a loss now, there's literally nothing out there relating to this issue and the only thing I can think of is an issue in my dev environment, could anyone list what I should have installed to get this working? Do I need something specific on the server (which is my local box).

    Finally, this is the sample I'm following: http://msdn.microsoft.com/en-us/library/cc488004(VS.90).aspx

    Wednesday, May 26, 2010 11:58 AM
  • have you identified the specific table? have you checked the data types? (see Data Type Mapping and Considerations in the docs)

    Wednesday, May 26, 2010 1:01 PM
    Moderator
  • Here's the scripted create of one of the problem tables:

    CREATE TABLE [dbo].[jtSysMeterMake](
    	[jtSysMeterMakeID] [int] IDENTITY(1,1) NOT NULL,
    	[MeterMakeCode] [varchar](2) NOT NULL,
    	[MeterMakeDescription] [varchar](50) NOT NULL,
    	[AddDate] [datetime] NOT NULL,
    	[AddByID] [int] NOT NULL,
    	[UpdateDate] [datetime] NULL,
    	[UpdateId] [int] NULL,
    	[LastEditDate] [datetime] NULL,
    	[CreationDate] [datetime] NULL,
     CONSTRAINT [PK_jtSysMeterMakeID] PRIMARY KEY CLUSTERED 
    (
    	[jtSysMeterMakeID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
    ) ON [PRIMARY]
    
    GO
    
    SET ANSI_PADDING OFF
    GO
    
    ALTER TABLE [dbo].[jtSysMeterMake] ADD DEFAULT (getdate()) FOR [AddDate]
    GO
    
    ALTER TABLE [dbo].[jtSysMeterMake] ADD CONSTRAINT [DF_jtSysMeterMake_LastEditDate] DEFAULT (getutcdate()) FOR [LastEditDate]
    GO
    
    ALTER TABLE [dbo].[jtSysMeterMake] ADD CONSTRAINT [DF_jtSysMeterMake_CreationDate] DEFAULT (getutcdate()) FOR [CreationDate]
    GO
    As far as I can see from the mappings document this should be OK, unless I'm missing something.
    Wednesday, May 26, 2010 1:37 PM
  • Could you please run this in VS debug mode and try to get the call stack for this exception? This would help to identify  the cause of the issue? 


    Ann Tang
    Friday, June 4, 2010 11:19 PM
  • Since the dummy columns created by the sync i.e.(__sysTrackingContext, __sysInsertTxBsn, __sysChangeTxBsn) has the keyword ‘sys’  occurring as the third character of their corresponding column names which is used for the internal purpose only. Rename the column name which has the 'sys' keyword in the third letter of the string name.
    Saturday, November 3, 2012 8:46 AM