October 13, 2004 at 8:00 pm
I have a SQL 2000 database that I am setting up to replicate to SQL CE. I have successfully configured everything with both horizontal and vertical filters, and the initial subscription and CE initialization works.
My problem is that in my snapshot, I have tables where the horizontal filter uses the value from another table (also replicated) For instance, Table1 has a column 'Visit' and the horizontal filter on Table1 is Visit = 1. Table2 has a horizontal filter of select ... where ID IN (Select ID from Table1 where Visit = 1) I can't alter Table2 to add any columns.
The first time I publish the snapshot, everything works great. If I then edit a row in Table1 and set Visit=1, that is now included in the snapshot, but the filter on Table2 is not re-run, so the data from Table2 is still missing.
How do I configure SQL 2000 to re-run the horizontal filters? If it's not configurable to happen automatically, is there a (.NET) API that I can use to force this, or a stored procedure that can be run?
Thanks!
Debbie
October 13, 2004 at 8:02 pm
I should mention that the replication type is 'Merge' and the PDA will have to pull from the server.
October 13, 2004 at 9:01 pm
I suspect you are not getting the new records because you have not synchronised the SQLCE database with the published database.
With SQL CE, the merge agent does not run unless explicitly told run. There is no real way around this because SQL CE is a single user database. This means that is the merge agent attempts to run when you application is running, it gets a sharing violation.
October 13, 2004 at 9:15 pm
My PDA app code has a repl.synchronize() in it. Do I need to do something else in order to Synchronize? The sequence of events in my application is that the user selects some subset of rows from 'table1' in which visit gets marked as 1 from a PC based application. They then go to the PDA application and hit a button that is supposed to download the new data. How does this fit with your comment about the merge agent not being able to run with my application running?
try
{
if (!File.Exists(@ceFile))
{
repl.AddSubscription(AddOption.CreateDatabase);
}
Cursor.Current = Cursors.WaitCursor;
repl.Synchronize();
Cursor.Current = Cursors.Default;
}
October 13, 2004 at 9:24 pm
Does this code get executed after the changes to the data are made ?
I have not actually coded an application on a PDA as yet so I am making assumptions that the above methods are the right ones.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply