Link to home
Start Free TrialLog in
Avatar of troubled_iis_user
troubled_iis_user

asked on

visual studio dataset multiple SQL Servers and Databases Merge

i have a dataset with 2 tableadapters in it. each table adapter pulls from a different database on a different SQL server. how can i combine the results from these two tableadapters. (they both "select * FROM" and have getdata() methods.  can i call the results from one tableadapter in the other tableadapter somehow? can i create a datatable and merge these two tableadapters somehow? any suggestions? i want to do everything in the dataset designer or the dataset class definition file, not through a windows forms class since i do not want this to be dependent on the page it sits on. thank you.
Avatar of graye
graye
Flag of United States of America image

If I understand your question, you want to pull data from two different databases, merge the two together, and then save the merged results to one (or perhaps both) databases?
If so, yes... there is a DataSet.Merge() method that will merget the two together.   Actually, it a tow part process... the Merge() just "decorate" the dataset with the "adds, deletes, and updates".  After that, you just do a DataAdpter.Update to save the changes.
http://msdn.microsoft.com/en-us/library/aszytsd8.aspx 
ASKER CERTIFIED SOLUTION
Avatar of troubled_iis_user
troubled_iis_user

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of troubled_iis_user
troubled_iis_user

ASKER

BIDS