We help IT Professionals succeed at work.

Make a VPN connection C#

Tomasz Czyz
Tomasz Czyz asked
on
7,149 Views
Last Modified: 2012-05-08
My application needs to get some data from a database on a server that only can be accessed through VPN. I have a website that do the same but the website doesn't need VPN because it can access the database local.

I thought to set up a VPN connection using C# so i can access the database. The only other way i see that maybe is possible to set up some connection to my website and go through that to the database.

The VPN i'm using now is a Cisco VPN connection.
I need to fill in this:

Hostname: xxx
(using group authentication)
Name: xxx
Password: xxx
Confirm Password: xxx

Then i need to fill in my personal username and password.

Username: xxx
Password: xxx

Do you have examples of a C# VPN connection or some other ideas?
Comment
Watch Question

Commented:
I don't think that programmaticaly  establishing a VPN connection is what you are looking for.  (This sounds like it would be a big hole in your network security).  Also,  I don't think that there is an API or library for establishing a VPN connection to a Cisco VPN server, and you would need to automate the process using the cisco client tools which would be challenging.

I would recommend creating web services (that can be ssl encrypted if you are passing sensitive information) for your c# application to access the data it needs over the internet.

You should read up on web services and n-tier architecture for ideas on how to implement an application that accesses a database behind a firewall.  
Tomasz CzyzSystem Administrator

Author

Commented:
I agree that it looks like a security hole, but that was the only option i saw. The information is not very sensitive, but i am very interested in the web services that you are talking about.

Do you have a (some) links with examples and descriptions how to make this.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Tomasz CzyzSystem Administrator

Author

Commented:
Thanks for the examples.

It looks difficult, and the only thing i want is to have a connection to the database and send it some SELECT and WHERE commands. Are you sure this is the best and easiest way to do this?

Maybe i should open a new Topic about web services and databases?
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.