I have a Silverlight (4.0) app (C#) with its own DB, SQL-Server 2008.
I need to connect to another DB instance on a different server. I need to execute only a SELECT query on that server to fetch some data to my application, clean it and put it in my DB.
I have the connection string for that DB and I’m planing to save it in the web.Config file of the application.
Is it possible to connect to that server and also keep the connection to my DB instance open at the same time?
Is this even possible? What should i be careful about when i do this? How should i manage 2 connections without loosing the data?
Your connections will be closed by default when using ADO.NET. Get the data from the second server with a new connection and store it in a dataset or datatable. Then, traverse the dataset/datatable and place that data into your database using your other connection. Just be sure to close your connections and you should be good to go. The only thing to watch out with this very simple model is if your datatable or dataset is very large, it will consume a bit of memory.