locked
Tracking In Sql CE (Insert /Update / Delete) when device in Disconnected Mode RRS feed

  • Question

  • Hi All,
    Now I am Working On Mobile Project  using client(sql CE) server(sql Server 2005) using Sync Services for Ado.net

     

    Now I am Facing  Problem of tracking the insert/update/delete rows in sql ce when the device is in disconnected mode.

     

    I need to populate the rows (insert/delete/update) in  data grid .
    In this forum i found one article .

    select

    * from <table name> Tbl where

    (((

    Tbl.__sysInsertTxBsn IS NOT NULL) AND ((Tbl.__sysInsertTxBsn NOT IN (select __sysTxBsn from __sysTxCommitSequence) AND Tbl.__sysInsertTxBsn > LCSN)

     

    OR (exists (select __sysTxBsn from __sysTxCommitSequence where Tbl.__sysInsertTxBsn = __sysTxBsn AND __sysTxCsn > LCSN)

     

    ))) OR ( (Tbl.__sysChangeTxBsn IS NOT NULL) AND ( (Tbl.__sysChangeTxBsn NOT IN (select __sysTxBsn from __sysTxCommitSequence) AND Tbl.__sysChangeTxBsn > LCSN)

     

    OR (exists (select __sysTxBsn from __sysTxCommitSequence where Tbl.__sysChangeTxBsn = __sysTxBsn AND __sysTxCsn > LCSN)

     

    ) ) ))

     

     but the problem is

    "The column name is not valid. [ Node name (if any) = ,Column name = LCSN ]"

    can any one help Me to execute the above query.

    Thanks




     

     

     

     

    • Edited by Venkata Lakshmi Narayana Friday, June 12, 2009 2:26 PM
    • Moved by Hengzhe Li Friday, April 22, 2011 2:58 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, June 12, 2009 2:23 PM

Answers

  • Hi All i found the solution .

    @LCSN which is the watermark for the last received anchor.

    the Query Is

    select  * from {0} Tbl where (((Tbl.__sysInsertTxBsn IS NOT NULL) AND ((Tbl.__sysInsertTxBsn NOT IN
    (SELECT __systxbsn
    FROM __systxcommitsequence)

    AND Tbl.__sysInsertTxBsn > @LCSN) OR (exists
    (SELECT __systxbsn
    FROM __systxcommitsequence
    WHERE tbl.__sysinserttxbsn = __systxbsn
    AND __systxcsn > @LCSN)

    )))
    OR
    ((Tbl.__sysChangeTxBsn IS NOT NULL) AND ((Tbl.__sysChangeTxBsn NOT IN
    (SELECT __systxbsn
    FROM __systxcommitsequence)

    AND Tbl.__sysChangeTxBsn > @LCSN) OR (exists
    (SELECT __systxbsn
    FROM __systxcommitsequence
    WHERE tbl.__syschangetxbsn = __systxbsn
    AND __systxcsn > @LCSN)

    ))))

    So if any one have any doubts.Please reach me

    pvlnarayana@gmail.com

    I will send the Sample Solution.


    Thanks
    Lakshmi Narayana

     

    Monday, June 15, 2009 12:59 PM