Murray Brown
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
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
did u getting any errors ?
ASKER
no
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the info ;)