473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DataBase doesn't AcceptChange

HI
I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method
The 2 dataset are filled by 2 adapters and the sources are 2 mdb database
When i merge datasets, it looks like the destination dataset takes the schema, but after the AcceptChanges method I can't see any change in the MDB database
What i'm missing
Code follows

DataSet1.Merge(DataSet2,true, System.Data.MissingSchemaAction.Add)
OleAdapter.Update(DatSet1,"Bookings")
DataSet1.AcceptChanges()
Thank yo
Fabrizio
Nov 16 '05 #1
2 2149
AcceptChanges doesn't send anything or do anything to the MDB file, it
merely changes the rowstate of the rows in your dataset so the DataAdapter
can make a determination whether or not to send those changes when/if Update
is ever called.

If you insert Debug.Assert(DataSet1.HasChanges) before you call update, I'm
guessing it will appear false. If the changes aren't taking, either your
update logic is failing (not necessarily raising an exception, but not
working as expected or the dataadapter isn't seeing any changes)j. If you
don't have any changes, call Update till the cows come home and nothing is
going to happen to your db. Similarly, AcceptChanges only concerns itself
directly with the local state of the dataset and is completely unrelated to
the backend (except that if you call it BEFORE you call update, your
rowstates won't be changed and nothing will get sent back to the db.).

Check out this article http://www.knowdotnet.com/articles/datasetmerge.html
It may be helpful.

HTH,

Bill
"Fabrizio" <an*******@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
HI,
I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method. The 2 dataset are filled by 2 adapters and the sources are 2 mdb database.
When i merge datasets, it looks like the destination dataset takes the schema, but after the AcceptChanges method I can't see any change in the MDB
database. What i'm missing?
Code follows:
DataSet1.Merge(DataSet2,true, System.Data.MissingSchemaAction.Add);
OleAdapter.Update(DatSet1,"Bookings");
DataSet1.AcceptChanges();
Thank you
Fabrizio

Nov 16 '05 #2
==============================================
you need to change the order

first
DataSet1.AcceptChanges();

then

OleAdapter.Update(DatSet1,"Bookings");

===============================================
"Fabrizio" <an*******@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
HI,
I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method. The 2 dataset are filled by 2 adapters and the sources are 2 mdb database.
When i merge datasets, it looks like the destination dataset takes the schema, but after the AcceptChanges method I can't see any change in the MDB
database. What i'm missing?
Code follows:
DataSet1.Merge(DataSet2,true, System.Data.MissingSchemaAction.Add);
OleAdapter.Update(DatSet1,"Bookings");
DataSet1.AcceptChanges();
Thank you
Fabrizio


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fabrizio | last post by:
HI I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method The 2 dataset are filled by 2 adapters and the sources are 2 mdb database When i merge datasets, it...
2
by: Fabrizio | last post by:
HI I'm trying to copy schema and data from a dataset to another, using DataSet.Merge method The 2 dataset are filled by 2 adapters and the sources are 2 mdb database When i merge datasets, it...
2
by: Dave | last post by:
I have a form which loads some database fields on the form that are bounded to some textboxes. The dataadapter allows for select, update etc. But when I change the information in the textboxes on...
0
by: darryldejesus | last post by:
Do you know how to set up a memory allocation for each database only not entirely for all the databases in a server using MS SQL? the plan is to configure a database to consume up to 500 mb (cache)...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.