Can't connect with Visual Web Developer Express
When attempting to use VWD Express' built-in web server I recieve the following error in browser window:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I've done the following:
- Followed advise onHow to: Configure Express to accept remote connections
- Retrievedport_address from SQL Server Configuration Manager (i.e. SQL Server 2005 Network Configuration > Protocols for SQLEXPRESS > Select TCP/IP Protocol name > RT click on Properties > IPALL - TCP Dynamic Portsport_address
- netstat -ano | findstr "port_address" shows the following
TCP 0.0.0.0:2247<-port_address 0.0.0.0:0 LISTENING 1620
- Attempted to connect to SQLEXPRESS service using dynamically assignedport_address with this command
F:\Program Files\Microsoft SQL Server\90\Tools\Binn>SQLCMD -S .\sqlexpress,2247
HResult 0x2AF9, Level 16, State 1
TCP Provider: No such host is known.
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
- I can successfully connect to SQLEXPRESS using SQLCMD with flags
- S .\sqlexpress
and
-S np:\\:\\.\pipe\MSSQL$SQLEXPRESS\sql\query (named pipes)
- Using VWD Database Explorer I have connected to my SQL Server 2005 Express databases and the Test Connection button on the Modify Connection form reports the connection strings are good. Lastly SQL connection string property field User Instance = True and neither database resides in "My Documents" folder.
Questions:
Does VWD local web server require configuration?
Is this a Named Pipe or TCP/IP configuration problem? Should Shared Memory be disabled?
Should I give up on VWD local webserver and install IIS instead?
[2617 byte] By [
Peter] at [2008-2-6]
Here's more info.
I'm not attempting to use VWD remotely. Both the web app and SSE are one the same machine, everything is local. I don't understand why VWD's built-in web server is complaining about a remote connection. Also Windows Firewall Protection is turned off but I've made sqlserver.exe and exception just to be safe.
So to summarize:
SQL Server Express is running and I can connect to using -S .\sqlexpress
and -S np:\\:\\.\pipe\MSSQL$SQLEXPRESS\sql\query flags. I cannot connect to SSE with a specific port address though.
I haven't modified the SQL Server connnection string VWD created and using the Test Connection button reports the connection string works.
I setup SSE to use dynamic TCP/IP ports w/ an w/o the SQL Browser Service without success.
Any help would be appreciated.
I'm going to move this over to the VWD forum since this is really about how VWD handles the connection to SQL. One of the gurus over there will be able to find an answer more quickly than I would.
Mike
Silly me, there isn't a VWD group, how odd. 
I'll do a bit of research and get back to you on this one.
Mike
I have the same issue. I can' t add much to the description of the problem that Peter provided, except the installation order. I installed Visual Basic 2005 Express, then Visual Web Developer 2005 Express, the SQL Server Express in that order over a period of a few days. I have seen in a readme file somewhere that SQL Server Express needs to be installed first, but I think that statement was referring to Beta releases. Also, I'm running XP Pro SP2.
Thanks
Russ
What user context are you're applications running under? Web applications typically don't actually run as your account, so it's easily possible that you will succed via SQLCmd logging in as you while the web app will fail as some other user such ASPNET.
Ensure that the user that your app is running under has permissions to the database.
Mike - SQL Express team
One thing to note: Named Pipes does not work when configured as the only client connectivity option for ASP.NET running in default circumstances. Have a look at the following article:
BUG: Named pipes do not work when worker process runs under ASPNET account
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315159
This is only an issue if you have disabled TCP/IP connections using the SQL Server Client Connectivity Manager
I uninstalled all of SQL Server Express and Visual Studio Express, made sure the account I was installing under and planning to develop under had Admin privileges, and then reinstalled everything. Not sure what part of that process made the difference, but I no longer have this problem. Thanks.
I have the exact same problem that Peter is having.
I read in a book that you need to be running Windows XP Pro for SQL Server Express to work - is that true?
Hi,
According to the documentation that can with Visual Studio Express under system requirements in the index in a footnote:
"3Windows XP Home does not support local Web application development; local Web application development is only supported in the Professional or Server versions of Windows."
Thanks