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);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)