Sync confusion
-
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
-
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
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
-
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
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
-
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
-
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.
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