Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Sync confusion

Sync confusion

Scheduled Pinned Locked Moved C#
databasesql-serversysadmintestingbeta-testing
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J Cop
    wrote on last edited by
    #1

    Hi! I have made a synchronization program for an Sql server express Db and a sql server ce 3.5 Db. I am doing some testing now and one thing confuses me. I am testing to make a delete on one row in Express and an update on the same row in the CE Db (the row with the same data, not the same row ID of course). What confuses me is that this works without crashing. Updating a row that has been deleted in the Express Db should throw an exception, shouldn't it? I am getting the data first from the Express Db with SqlDataAdapter, then replacing the itemArray and finally using SqlCommandbuilder.getUpdateCommand() and adapter.Update(). Is it the commandbuilder that ignores this or what? Thanks for your help, Jacob

    B L 2 Replies Last reply
    0
    • J J Cop

      Hi! I have made a synchronization program for an Sql server express Db and a sql server ce 3.5 Db. I am doing some testing now and one thing confuses me. I am testing to make a delete on one row in Express and an update on the same row in the CE Db (the row with the same data, not the same row ID of course). What confuses me is that this works without crashing. Updating a row that has been deleted in the Express Db should throw an exception, shouldn't it? I am getting the data first from the Express Db with SqlDataAdapter, then replacing the itemArray and finally using SqlCommandbuilder.getUpdateCommand() and adapter.Update(). Is it the commandbuilder that ignores this or what? Thanks for your help, Jacob

      B Offline
      B Offline
      Bharat Jain
      wrote on last edited by
      #2

      Are you using Microsoft's Sync Framework ?? If yes then it is been taken care Microsoft's Sync Framework , if not if it is a query base update then in most case the query with a were clause at the end (update table where id = ? ) if sql does not find a record it does not update anything and move ahead , it is not necessary for for sql to update something. I hope this is understandable

      -Regards Bharat Jain bharat.jain.nagpur@gmail.com

      J 1 Reply Last reply
      0
      • J J Cop

        Hi! I have made a synchronization program for an Sql server express Db and a sql server ce 3.5 Db. I am doing some testing now and one thing confuses me. I am testing to make a delete on one row in Express and an update on the same row in the CE Db (the row with the same data, not the same row ID of course). What confuses me is that this works without crashing. Updating a row that has been deleted in the Express Db should throw an exception, shouldn't it? I am getting the data first from the Express Db with SqlDataAdapter, then replacing the itemArray and finally using SqlCommandbuilder.getUpdateCommand() and adapter.Update(). Is it the commandbuilder that ignores this or what? Thanks for your help, Jacob

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        You might check the return value, it should equal the number of rows affected. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


        1 Reply Last reply
        0
        • B Bharat Jain

          Are you using Microsoft's Sync Framework ?? If yes then it is been taken care Microsoft's Sync Framework , if not if it is a query base update then in most case the query with a were clause at the end (update table where id = ? ) if sql does not find a record it does not update anything and move ahead , it is not necessary for for sql to update something. I hope this is understandable

          -Regards Bharat Jain bharat.jain.nagpur@gmail.com

          J Offline
          J Offline
          J Cop
          wrote on last edited by
          #4

          Hi yes, of course. Thank you. No, I didn't understand the synchronization examples using Microsoft's Sync Framework that I've found here and when googling so I made it myself.

          B 1 Reply Last reply
          0
          • J J Cop

            Hi yes, of course. Thank you. No, I didn't understand the synchronization examples using Microsoft's Sync Framework that I've found here and when googling so I made it myself.

            B Offline
            B Offline
            Bharat Jain
            wrote on last edited by
            #5

            Hi Jacob, I ya know Microsoft's sycn framework is bit hard to understand , but some times proves worth all the time you put in , anyways if your problem is solved without using it , its gr8 , any thing which works fine is fine :)

            -Regards Bharat Jain bharat.jain.nagpur@gmail.com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups