Export SQL Database Object

G

Guest

Hi,

Is there any way to export object and data between SQL server databases
programatically? I would like to create windows form using C# to export data
from DQL setrver to another SQL server database. Your help is highlt
appreciated!!

Thanks
Anwar
 
W

W.G. Ryan eMVP

Try filling the dataset but set the AcceptChangesDuringFill property to
false. This will ensure that the rowstate of each of the rows is Added.
Then, use the exact same dataset and call Update on a second adapter
pointing to the destination table.
 
G

Guest

I haven't tried this but I believe that this should work. This is sending
you on the right path to getting your answer, may not be exactly what you
need.

you can extract the data from one server using your sql connection, sql
command, data adapter and datasets. Then you can chose to <DataSet
Name>.WriteXml method of dataset to save it as xml. After that you can use
<DataSet Name>.ReadXml to read that xml in any future time if you like.

once you read the xml into the dataset you can reset your connection to the
destination sql server than just do you normal update method of dataadapter
to copy over all the modified or changed data from your dataset to you new
sql database.
 
G

Guest

It should be able to over write into the destination. Same database is
existing there.And if I made any changes in property like int, char etc,...
in the source database it should copy that as well into the destination.
Please help me to solve this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top