I want to copy data records from one table in the database to another table in a different database.
I am using two different connection strings for source and destination connections.
SQL = "Select * from Employee";
DT = dbCommServer.GetDataTable(SQL); // DT stores records from one Table.
// Query to insert Records from Source Table to destination Table in different Database.
SQL = "INSERT INTO [EmployeeLocal] ( [EmpID],[EmpName], [Salary]) ";
SQL += "VALUES ('Select [EmpID],[EmpName], [Salary] from [DT]')";
dbCommLocal.ExecuteCommand(SQL);
This code doesn't insert any records into the destination table.
Please suggest any suitable way to insert table records stored in DT
into another table in a different database.
Best regards.