locked
Please Fix Sample Posted On CodeProject RRS feed

  • Question

  • Thanks for the great article you posted on code project[1]. 

    Well done, other than you may want to fix the triggers in the sample because they are horribly broken if more than 1 record is inserted or updated, and I worry that people will just copy paste without knowing it.

    "Take Data Offline Using Microsoft Synchronization Services for ADO.NET"

    [1] http://www.codeproject.com/smartclient/takedataoffline.asp

    Thanks!

    P.S.

    <language type="c#" action="police">

     I noticed you are using C style test of bool condition, although the code is C#, which has a native bool type.

    if (false == File.Exists(...)) //redundant equality comparison of 2 bools.

    if (!File.Exists(...)) //correct

    </language>

    • Moved by Max Wang_1983 Friday, April 22, 2011 11:08 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, March 20, 2007 7:18 AM

Answers

  • Hi there,

    Thanks! I am glad you liked the article.

    I tried to keep the triggers and the code as simple as possible. It has limitations as you pointed out but it is not intended as production code. I think that once developers get familiar with the framework, they will expand on the change tracking triggers and sync commands to add their custom logic.

    I will review the trigger though and see what I can do without sacrificing simplicity.

    As for the C-style note; I agree with you, my heavy C\C++ experience still influencing my code but I am getting better at it ;)

    Thanks!

    Tuesday, March 20, 2007 4:51 PM

All replies

  • Hi!

    how can I improve the triggers??

    thx

    Tuesday, March 20, 2007 1:41 PM
  • Hi there,

    Thanks! I am glad you liked the article.

    I tried to keep the triggers and the code as simple as possible. It has limitations as you pointed out but it is not intended as production code. I think that once developers get familiar with the framework, they will expand on the change tracking triggers and sync commands to add their custom logic.

    I will review the trigger though and see what I can do without sacrificing simplicity.

    As for the C-style note; I agree with you, my heavy C\C++ experience still influencing my code but I am getting better at it ;)

    Thanks!

    Tuesday, March 20, 2007 4:51 PM