Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merging Two Datasets
Message
From
21/10/2004 09:20:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Merging Two Datasets
Miscellaneous
Thread ID:
00953263
Message ID:
00953263
Views:
63
Good morning,

I have read the previous posts in this forum about Joining two datasets, but I cannot seem to get mine to work. One of my datasets comes from SQL SErver, the other from an Access database.

Both datasets are identical, but the Merge does not seem to be working.

The dataset for the access database has no rows and I am trying to populate it with the data in the SQL dataset (has roughly 15 rows in this example).

Here is my code, can someone please tell me what I am missing?
Dim ds As DataSet
Dim dsA As DataSet

Dim cn As OleDbConnection
Dim connstr As String

bizRoles = New Roles

ds = New DataSet
dsA = New DataSet

connstr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=c:\dev\kilimanjaro\csi.mdb"


'First, establish a connection to Access
cn = New OleDbConnection(connstr)
cn.Open()

'Now, get the data
Dim da As New OleDbDataAdapter("SELECT * FROM usrgrpw1", cn)

'Next, get the data from SQL
ds = bizRoles.GetGroupMembersReport()

'This should create the Access dataset, correct?
da.Fill(dsA, "NewDataSet")

'Now merge from SQL to Access
dsA.Merge(ds)

dsA.AcceptChanges()
Many thanks!

Scott
Reply
Map
View

Click here to load this message in the networking platform