Hemant Kamalakar

Hi,
I have populated a DataSet(dsLocal) containing rows from local database that I wish to update with the rows taken from another dataset (dsWeb).

dsWeb dataset may contain Newly added rows and/or modified rows.

dsweb is populated from the Web server Database and dsLocal is populated from Local database

Both Local and Web server database schema are same.

Can i use the SQLBulkCopy class



Re: Architecture General How to insert new rows and update modified rows in the destination Database using SQLBulkCopy class

Tamer Fathy

SqlBulkCopy is a new feature in ADO.NET 2.0 that gives you DTS-like speeds when you need to programmatically copy data from one database to another.

so as long as the source and the destenation (tables, database) are identical

for more help check those links

http://davidhayden.com/blog/dave/archive/2006/03/08/2877.aspx






Re: Architecture General How to insert new rows and update modified rows in the destination Database using SQLBulkCopy class

Hemant Kamalakar

Thanks for your quick reply and consideration.

My both (Remote and client Databases) are having the same schema.

I have written a web service that fetches the new/modified records from the Web server database.
I want to add/update the new/modified records to the client database

I have created a DataSet(dsLocal) containing rows from local database that I wish to update with the rows taken from another dataset (dsWeb).

dsWeb dataset may contain Newly added rows and/or modified rows.

dsweb is populated from the Web server Database and dsLocal is populated from Local database

can i use SQLBulkCopy in this scenario






Re: Architecture General How to insert new rows and update modified rows in the destination Database using SQLBulkCopy class

Tamer Fathy

Oh i get it now you want to synchronize the data on you database so they will have the same data at any time.

there are many ways to implement this.

but as your situation i advise you to read this article it was realy great it synchronize data over multiple databases using a web service which run on regular bases

http://www.devx.com/dotnet/Article/20418/0/page/1

Thanks,

Tamer Fathy






Re: Architecture General How to insert new rows and update modified rows in the destination Database using SQLBulkCopy class

Hemant Kamalakar

Thanks,

I have already implemented the Web service using the DevX article (http://www.devx.com/dotnet/Article/20418/0/page/1) by Alex Homer.

But using it I can add only new rows to the database.

what about synchronizing changes to existing rows in the databases