Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.net Access table online synchronizing with same on desktop (VB.net)

Hi

I have an ASP.net 4 website application that has an Access database with 2 tables.
I have exactly the same database on my desktop and want to pull the data from my online
Access database tables into the tables on the Access database on my desktop. How would one do this? What VB.net code would I use. I have already written the code below to connect to my databse

Protected Sub Button_AllData_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button_AllData.Click
        '// define a connection to the database

        Dim cs As String = ConfigurationManager.ConnectionStrings("WhatEverNameYouWant").ConnectionString
        cs = cs.Replace("App_Data\GC.accdb", Server.MapPath("App_Data\GC.accdb"))


        Dim cn As New OleDbConnection(cs)

        '// define the sql statement to execute
        Dim cmd As New OleDbCommand("SELECT * FROM Performance", cn)

        Try

            '// open the connection
            cn.Open()

            '// execute the sql statement
            Using reader As OleDbDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)

                ' While reader.Read()
                '// this loops through all of the returned records
                'Response.Write("blah")
                'End While

                GridViewData.DataSource = reader
                GridViewData.DataBind()

            End Using


        Catch ex As Exception
            Response.Write(ex.Message)

        Finally
            If cn.State <> ConnectionState.Closed Then
                cn.Close()
            End If
        End Try
    End Sub

Open in new window

Avatar of Jini Jose
Jini Jose
Flag of India image

did u getting any errors ?
Avatar of Murray Brown

ASKER

no
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for the info ;)