i have web application. i want to transfer data with tables from one database to other database in the diiferent server offline.
how to do plz tell me.
i did the some code:
source = ConfigurationManager.AppSettings["ServerName"].ToString();
database = ConfigurationManager.AppSettings["DatabaseName"].ToString();
userid = ConfigurationManager.AppSettings["UserId"].ToString();
pwd = ConfigurationManager.AppSettings["Password"].ToString();
string DestinationServer = ConfigurationManager.AppSettings["DestinationServer"].ToString();
string Duserid = ConfigurationManager.AppSettings["Userid"].ToString();
string Dpass = ConfigurationManager.AppSettings["password"].ToString();
SqlConnection dbcon1 = new System.Data.SqlClient.SqlConnection(source);
dbcon1.Open();
SqlConnection dbcon2 = new System.Data.SqlClient.SqlConnection(DestinationServer);
dbcon2.Open();
SqlDataReader dr;
SqlCommand cmd = new SqlCommand("select * from tblClientInfo",dbcon1);
dr = cmd.ExecuteReader();
while (dr.Read())
{
string Sql = "insert into tblClientInfo(ClientId,Name) values(" + dr.GetInt32(0).ToString() + "," + dr.GetString(1) + ")";
SqlCommand cmd1 = new SqlCommand (Sql,dbcon2);
Posted Jul 27, 2013, 5:19 AM
http://www.c-sharpcorner.com/uploadfile/muralidharan.d/basic-ssis-data-transformation/
Iftikar HussainPosted Jul 27, 2013, 5:06 AM
You can use SSIS for this purpose. Please refer the link
http://msdn.microsoft.com/en-us/library/ms141026.aspx
http://www.codeproject.com/Articles/155829/SQL-Server-Integration-Services-SSIS-Part-1-Basics
Regards,
Iftikar
Posted Jul 26, 2013, 2:56 PM
What do you mean by offline?