Question Cannot get Visual Studio 2010 Ultimate to connect to a MSSQL 2005 database via VPN


New member
Jul 27, 2010
Programming Experience
Hello all.

I was wondering if this is possible at all.

We have a programmer who is working on an application from home but he wants to utilize the database that is at work. As of right now, I have asked him to establish a VPN connection to the SQL server which he can successfully. He can ping the server, remote desktop etc. But he cannot connect to the database on the server itself through Visual Studio. The Microsoft SQL server is version 2005 and only allows Windows Authentication since we have other users that are on site that gain access to their databases that way.

He has tried all sorts of things in the web.config of his application including impersonation, integrated security etc. What is the way to get this to work? If not, what alternatives does he have? I have been looking into this for 3 days now and I have not come across any clear info on how Visual Studio behaves over VPN. The remote machine is not joined to the domain btw. Please see the attached image for a graphical representation.

The latest error he gets and that I can see in the server log as well is:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.

His connection string looks like this:

<add name="myapplicationConnectionString" providerName="System.Data.SqlClient"
connectionString="Data,1433\MSSQLSERVER;Initial Catalog=application_database;User Id=domain_user;Password=password_here;
Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30" />

I am really confused about Visual Studio authentication over the internet. Would somebody be so kind as to give me a general picture of how this works and what I can do to get it working? I am looking for some step by step advice if possible as I seem to be unable to piece the whole picture together from what I've come across.

Thank you in advance for reading!

vs issue2.jpg


Well-known member
Apr 25, 2006
Programming Experience
Ehmm.. Can you specify domain credentials in the connection string? I thought something funky went on elsewhere for that security to work. If the guy on the vpn isn't authenticating on the domain and the sqlserver will only accept authenticated users, the dmoain controller may well say the connection isnt authenticated..
I'm not 100% clued up on how it works in that regard but i think:
The username and apssword quoted in the conn str are only used when the SQLS accepts u/p logon (e.g. sa/password) so you can consider configuring the SQLS to allow this kind of auth and creating a user for him / giving him the creds
If domain creds really can be passed in the conn str, try putting user@domain or domian\user as the username (replacing those words with relevant values)
If domin auth is your only option, have a razz through the vpn dialup options for the settings necessary to join the domain.. if they aren't there, they might be on the logon screen (i seem to remember that the windows logon screen lets you dial a connection before going through the logon process)
Top Bottom