locked
Data conversion failed. [ OLE DB status value (if known) = 0 ] RRS feed

  • Question

  • Hi,

     

    I'am using Sync Framework to sync an Oracle Backend to a local SQL Server CE database.

    There are about 16 tables that will be synced.

    Now I have the problem that I get a "Data conversion failed. [ OLE DB status value (if known) = 0 ]" Exception on synching a table having a Oracle NUMBER type as Primary key. Other tables having a string key will be synced without any errors.

     

    I Use MSF 1.0 and ADO Services 1.0 SP 1, SQLServer CE 3.5 SP1

     

    Below the SyncSchema and Oracle DB Script:

     

    // add new table

    syncSchema.Tables.Add(Table);

    // add TKEY column to table

    syncSchema.Tables[Table].Columns.Add("TKEY");

    syncSchema.Tables[Table].Columns["TKEY"].AllowNull = false;

    syncSchema.Tables[Table].Columns["TKEY"].ProviderDataType = "NUMERIC";

    syncSchema.Tables[Table].Columns["TKEY"].NumericPrecision = 1;

    syncSchema.Tables[Table].Columns["TKEY"].NumericScale = 0;

    syncSchema.Tables[Table].PrimaryKey = new[] { "TKEY" };

    // add PDORG_KEY column to table

    syncSchema.Tables[Table].Columns.Add("PDORG_KEY");

    syncSchema.Tables[Table].Columns["PDORG_KEY"].DataType = typeof(string);

    syncSchema.Tables[Table].Columns["PDORG_KEY"].MaxLength = 32;

    // add NAME column to table

    syncSchema.Tables[Table].Columns.Add("NAME");

    syncSchema.Tables[Table].Columns["NAME"].DataType = typeof(string);

    syncSchema.Tables[Table].Columns["NAME"].MaxLength = 80;

    // add NAME_SHORT column to table

    syncSchema.Tables[Table].Columns.Add("NAME_SHORT");

    syncSchema.Tables[Table].Columns["NAME_SHORT"].DataType = typeof(string);

    syncSchema.Tables[Table].Columns["NAME_SHORT"].MaxLength = 20;

    // add HIERARCHY_LEVEL column to table

    syncSchema.Tables[Table].Columns.Add("HIERARCHY_LEVEL");

    syncSchema.Tables[Table].Columns["HIERARCHY_LEVEL"].ProviderDataType = "NUMERIC";

    syncSchema.Tables[Table].Columns["HIERARCHY_LEVEL"].NumericPrecision = 1;

    syncSchema.Tables[Table].Columns["HIERARCHY_LEVEL"].NumericScale = 0;

     

     

    CREATE TABLE Test

    (

    TKEY NUMBER NOT NULL,

    PDORG_KEY VARCHAR2(32 CHAR) NOT NULL,

    NAME VARCHAR2(80 CHAR),

    NAME_SHORT VARCHAR2(20 CHAR) NOT NULL,

    HIERARCHY_LEVEL INTEGER DEFAULT 0 NOT NULL

    )

     

    Any ideas why this happens?

     

    • Moved by Hengzhe Li Friday, April 22, 2011 7:46 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, November 28, 2008 3:08 PM

Answers

  • Hi,

     

    I solved the problem.

    In the database there was a column allowing NULL values, but my SyncSchema did not consider this.

    An other error was the numeric precision in the sync schema.

     

     

     

    Monday, December 1, 2008 11:37 AM