We have a legacy WinForms application (written by other people) which connects to SQL Server directly using ADO.NET (.NET 2.0, C#). We want to teach this application to talk to SQL Server which is far-far away (not in the same LAN where the app is working).
The first idea came to my mind is to make it in the same way as SSL Explorer (http://sourceforge.net/projects/sslexplorer/) works: to make a tunnel (still don't know how) and change the ADO.NET connection string to 127.0.0.1:34761 (some port), and to make so that the .NET application connects to local port thinking that this is SQL Server instance, our code will redirect this traffic somehow to our web service (that is close to where the real SQL Server is), and our web service connects to real SQL Server.
So, in general the goal is next: without modifying all the code of C# application, to add some lines in the beginning of Main() method (to initialize a tunnel), and to develop an ASP.NET web service which gets all packets and forwars to real SQL Server instance.
Question: does anyone know how to make such a "tunnel"?
Maybe someone knows if there are some working samples?