When I deploy to the web server, I get this error: remotely and local from the web server.
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
My web config contains this:
<connectionStrings><
remove name="LocalSqlServer"/><add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /></
connectionStrings> There is no sql server install on the Web Server. I used vs.net 2005 to create the site.
Thanks for any help or information.
![]() |
0 |
![]() |
Hey,
Well, the Membership setup by default does use SQL Server, and if you don't have it on the web server, then that could be a problem... It needs to have at least SQL Server Express database installed... When you setup this provider using the ASP.NET configuration tool, it creates the aspnetdb.mdf file that contains all the security information.
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
![]() |
0 |
![]() |
Thank you. That does appear to be the problem.
So i opted to use that aspnet_reg utility to create the aspnetdb database on an established sql server 2005 instances...
I modified my web.config to point to it (renamed my local /data/aspnetdb.mdf to be sure), add users and roles again and and the application works fine from my vs.net client.
Now I deploy again to the web server, and at first I was getting :
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
so, i added this to my web.config:
<identity impersonate="true" userName="server\user" password="password"/>
and now, it's apparently talking to the database, as when I enter a bad password i get the expected message. However, if i enter the right password, when the page attempts to go to the destination sucess page which is under a directory that allows "all users" = allow, but annonymous = deny, i get the original error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
which is apparently happening as the the backend membership code tries to go to the database to authenticate if access to that page is okay - maybe it's not using my impersonate. If not, maybe I need to add another user to the database? Which one? The IIS website it set to enable annonymous access with that common IUSR_servername
I'm thinking maybe that maybe i need to open aspnet user access in the database? but to which user exactly?
![]() |
0 |
![]() |
jcnet:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Hi
Please make sure your Firewall already enabled for TCP port 1433. Then please refer this troubleshoot article (It's for SQL Server 2000, but still available to SQL Server 2005):
http://support.microsoft.com/kb/827422/en-us
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
![]() |
0 |
![]() |
Hi -
Did you ever get this all working? I am having a simliar issue on my server(s) and made another post http://forums.asp.net/p/1120765/1749277.aspx#1749277, but as of yet I have no clue where to figure this out?
I ran the aspnet_regsql.exe and it created the spnet database, but I don't know how to proceedfrom here?
Thanks,
Joe
![]() |
0 |
![]() |
Hi sorry for delayed response. I did by switching over to sql server authentication and setting user/password in my webconfig file connection string.
![]() |
0 |
![]() |