|
-
Oct 18th, 2002, 10:31 AM
#1
Thread Starter
Fanatic Member
Merge wont work??
I have the following code to write an xml file from "rsPick" and then merge "rsPick" with "rsArchive"
'''''''''''''code''''''''''''''''''
dsPick.WriteXml("C:\mydata.xml")
daArchive.FillSchema(dsArchive,SchemaType.Source, "tblPick")
daArchive.Fill(dsArchive, "tblPick")
dsArchive.Merge(dsPick)
daArchive.Update(dsArchive, "tblPick")
'''''''''''''''''''''''''''''''''''''
The xml file is written away succesfully but when I look at "tblPick" which is the access table acting as the source for dsArchive no new rows have been added!
What am I doing wrong?
Both schemas are similar.
This is driving me nuts.
-
Oct 18th, 2002, 10:40 AM
#2
a dataset can have multiple tables, see if it added another table to the dataset with the other datasets info.
-
Oct 18th, 2002, 10:44 AM
#3
Thread Starter
Fanatic Member
I know this is going to sound pig ignorrant Edneeis
but how?
I am not sure what you mean. Where do the tables come into play. I thought we where dealing directly with datasets.
-
Oct 18th, 2002, 11:30 AM
#4
A dataset is a collection of datatables which is a collection of datarows which is a collection of datacolumns.
One way to find out is to call:
Msgbox(dsPick.Tables.Count)
before the merge and then again after.
-
Oct 21st, 2002, 06:02 AM
#5
Thread Starter
Fanatic Member
I tried your messagebox :
Msgbox(dsPick.Tables.Count)
the result was 2. What does this mean? I am still struggling with this.
-
Oct 21st, 2002, 06:05 AM
#6
Thread Starter
Fanatic Member
What I mean to say is that before the merge operation I have 1 table, and after I have 2 but the underlying database remains unchanged!
-
Oct 21st, 2002, 10:27 AM
#7
See it is merging the datasets not the tables. Also the database wouldn't be updated until you used the dataadapter again to update it, since all data is by default disconnected. You may want to loop through and add all the rows in the one to the table in the other.
VB Code:
'something like this
dim dr as DataRow
For Each dr in ds1.Tables(0).Rows
ds2.Tables(0).Rows.Add(dr)
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|