I need to write a console app that queries two databases on two different servers: one is SQL Server, and the other is Oracle; and saves the data to another SQL Server.
I'm very confused about connections I did the connection well.
Can I open connection inside another connection to write Select and Insert to?
I write the connection to the other servers as also and it's connected. My problem is how to write insert to (to the other server)?
sqlconn.Open();
SqlCommand com = new SqlCommand("SELECT Email, Badge, Name FROM PublishedWorks", sqlconn);
using (SqlDataReader reader = com.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader[0]);
}
}
Where do I have to write the insert?
Can anyone help me please?
Thanks,