hi all
I fill my dataset from two different databases using odbc and sql adapter. But i need to update my parodox table data with data from sql table.
which way o method i need to use . i have no idea
my code to load data works and returns resultWhat can i do to save data from test 2 to test1 table ?? please give directionvb.net Code:
' load data to dataset Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim s As String s = "DRIVER=Microsoft Access Paradox Driver (*.db);UID=admin;" & _ "UserCommitSync=Yes;Threads=3;SafeTransactions=0;ParadoxUserName=admin;ParadoxNetStyle=4.x;Paradox;" & _ "NetPath={0};" & _ "PageTimeout=600;MaxScanRows=8;MaxBufferSize=2048;" & _ "FIL=Paradox 5.X;DriverId=538;" & _ "DefaultDir={0};" & _ "DBQ={0};" & _ "CollatingSequence=ASCII" s = "FILEDSN=paradox.dsn" Dim c As String c = "server=serveris;user id=sa;password=mypsw;Database=database" Dim sSQL As String Dim d As New DataSet() Dim f As New DataSet() ' Load the target data and name the table Dim oConn = GetNewConnection() sSQL = "SELECT f1,f2 FROM test1;" Dim adapter As Odbc.OdbcDataAdapter adapter = New Odbc.OdbcDataAdapter(sSQL, s) adapter.TableMappings.Add("table", "test1") d = New DataSet() adapter.Fill(d, "test1") d.AcceptChanges() ' Load the source data, set table name and PK Dim cSQL As String ' Create and open a new connection to local backup MDB Dim Conn = GetNewConnectionSQL() cSQL = "SELECT f1,f2 FROM test2;" Dim cadapter As SqlClient.SqlDataAdapter cadapter = New SqlClient.SqlDataAdapter(cSQL, c) cadapter.TableMappings.Add("table", "test2") f = New DataSet() cadapter.Fill(f, "test2") d.Merge(f) datagrid.DataSource = d End Sub
Thanks .



Reply With Quote
