locked
Parameter Marker RRS feed

  • Question

  • Hi,

    I'm trying to do a bidirectional synchronization between a client (SQLServerCE) and a server (MySQL) using the Decoupled Change Tracking aproach (http://www.syncguru.com/projects/SyncServicesDemoDecoupledTracking.aspx).

    Everything is set up but I'm getting an error for which I haven't found a solution for yet.

    By checking the tracer log I figured out that if I use the "?" Parameter Marker in the SelectIncrementalInsertsCommand's parameters these are passed to the stored procedure as NULL. On the other side if I use the "@" Parameter Marker I get an exception - "Parameter ?id not found in the collection" - although in the tracer log they're caught and populated correctly.

    cmd.Parameters.Add("?id", MySqlDbType.VarChar).Direction = ParameterDirection.Input;
    vs
    cmd.Parameters.Add("@id", MySqlDbType.VarChar).Direction = ParameterDirection.Input;

    It looks like a MySQL is expecting "?" but the Sync Framework only is able to fill the parameter values if they start with "@".

    Does anyone have a solution for this?

    ---
    Wilson Oliveira
    • Moved by Hengzhe Li Friday, April 22, 2011 5:43 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, February 12, 2009 1:10 AM

All replies

  • I've updated to mysql-connector-net-5.2.5 which uses "@" as a Parameter Marker and this problem is now fixed.

    ---
    Wilson Oliveira
    • Proposed as answer by Patrick S. Lee Monday, February 16, 2009 7:40 PM
    Thursday, February 12, 2009 9:52 PM