I am trying to carry out a synchronisation of two databases one on the server and the other on a local machine so that even when they are not connected on the networkthe local database can carry on accepting data but when the network is back on the local database can update the server and the server can also update the local machine with data it accepted during the time when the network was off. by first comparing two tables in two databases and then if they are any differences the updating begins and i've since been stuck.anny help will be appreciated.I've uploaded a copy of the sdf database.

Private Sub btnCompareTables_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompareTables.Click
        'dont know which arguments to put when calling this function
        'How do i tell the computer which databases to compare

    End Sub

    Public Function MdfData(ByVal SqlMdfData As DataTable)

        'MDF data container

        Dim sql_Sel As String = "Select * From Workers"
        Dim mdfme As DataTable = MyFormz.cl_Class.SelectRows_Web(sql_Sel)

        Return mdfme

    End Function

    Public Function SdfData(ByVal SqlSdfData As DataTable)

        'MDF data container

        Dim sql_Sel As String = "Select * From Workers "
        Dim sdfme As DataTable = MyFormz.cl_Class.SelectRows_local(sql_Sel)

        Return sdfme

    End Function

    Sub Comparing(ByVal dtEmployeessdf As DataTable, ByVal dtEmployeesmdf As DataTable)
        'Trying to carry out synchronisation using code
        For Each drEmployeesmdf In dtEmployeesmdf.Rows
            For Each drEmployeessdf In dtEmployeessdf.Rows
                If drEmployeessdf("First_Name") = drEmployeesmdf("First_Name") Then
                    If drEmployeessdf("Last_Name") = drEmployeesmdf("Last_Name") Then
                        If drEmployeessdf("Full_Name") = drEmployeesmdf("Full_Name") Then
                            If drEmployeessdf("ID") <> drEmployeesmdf("ID") Or drEmployeesmdf("ID") <> drEmployeessdf("ID") Then
                                ' There is a row that has not been confirmed, update confirmed and move on
                                'how do i tell the computer to add the contents of sdf database that are not
                                'in the server database to the server database 
                                'how do i tell the computer to add the components of the server database that are not in the
                                'sdf database into the sdf database
                                drEmployeessdf("") = ""
                                Exit For

                                'p = p + 1
                            End If
                        End If
                    End If
                End If
            'ProgressBar1.Value = ProgressBar1.Value + 1
            'a = a + 1

    End Sub
6 Years
Discussion Span
Last Post by __avd
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.