how to insert one table data from one database to oher database
-
Hi all, i want to know that, How to insert one table records from one database to another table in other database using webservices in vb.net or C#. ex: databse name: PRS1 table name: sample1 | | databse name :PRS2 table name : sample2
-
Hi all, i want to know that, How to insert one table records from one database to another table in other database using webservices in vb.net or C#. ex: databse name: PRS1 table name: sample1 | | databse name :PRS2 table name : sample2
I don't know why you want to use webservice. But easy way is to use Datatable to store Temporarily data. This can work if both databases are on same domain. I use free sqlhepler class to connect with database. ------------------------------------------------------------------------------ string sql="Select user_id,name from user_master"; DataTable dt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionStringfordatabase1, CommandType.Text, sql); foreach (DataRow dr in dt.Rows) { sql = "Inser into user_master (user_id,name) values('" + dr["user_id"] + "','" + dr["name"] + "')"; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringfordatabase2, CommandType.Text, sql); } ------------------------------------------------------------------------------
Regards, Mayank Parmar Senior Software Engineer Amba Tech Gandhinagar, India