Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Change tracking INSERT issue

Avatar of mekke10
mekke10Flag for United States of America asked on
.NET ProgrammingVisual Basic.NETMicrosoft SQL Server 2008
3 Comments1 Solution295 ViewsLast Modified:
I have a database with 3 patient tables and need to sync this database with a sql server 2008 with change tracking.
the local database is a compact edition 3.5, the sql server 2008 has row and column tracking enabled.

When i add a record, i have to insert one record in all three tables:

*the GUID is a unique identifier PK, the recno an integer and the rest is some data...

Up till this point everything is fine because all of them show up nicely in the local compact edition database. However when i sync with direction set as bidirectional for all tables the record is visible in the first table on the sql server 2008, but not the other two.

I tried doing the inserts together, i tried doing them seperate. The PatientMaster syncs fine, the PatientInfo doesn't nor does the PatientLupusIdent

Anyone have any ideas?

Dim qtext1 As String = "INSERT INTO tblPatientMaster (GUID, RecNo, Q5A, Q6) VALUES (convert(uniqueidentifier,'" & id & "'),0,0,'" & _ssn & "')"
            Dim qtext2 As String = "INSERT INTO tblPatientInfo (GUID, RecNo) VALUES (convert(uniqueidentifier,'" & id & "'),0)"
            Dim qtext3 As String = "INSERT INTO tblPatientLupusIdent (GUID, RecNo) VALUES (convert(uniqueidentifier,'" & id & "'),0)"

Dim cn As New SqlCeConnection(Connections.localConnection)
Dim cm As New SqlCeCommand(qtext1, cn)

...same for qtext2 and qtext3

Dim syncAgent As New BManager.GALR_Pilot_DataCacheSyncAgent()
Avatar of mekke10
mekke10Flag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers