aspnetdb membership security working fine on client, won't work on web server

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:


<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />


 There is no sql server install on the Web Server. I used 2005 to create the site.


Thanks for any help or information.


6/6/2007 4:09:07 PM 27051 articles. 1 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 13


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.


"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).
6/6/2007 5:36:55 PM

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 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? 



6/6/2007 8:45:22 PM


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)


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):;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.
6/7/2007 7:49:28 AM

Hi -

Did you ever get this all working? I am having a simliar issue on my server(s) and made another post, 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?




6/12/2007 9:13:40 PM

 Hi sorry for delayed response. I did by switching over to sql server authentication and setting user/password in my webconfig file connection string.

6/23/2007 3:38:58 PM

Similar Artilces:

Web app won't work on production server, but works on testing server.
Hi, I have been trying to figure out this problem to no success.  I hope someone understands what is going on. I am using ASP.NET 2.0 on both servers.  I am trying to test a simple app that creates a simple treeview out of the sites directory structure.  It uses a custom provider written by "4GuysFrom..." called FileSystemSiteMapProfiler.  All the app is a page that creates a tree structure of my websites folder and files.  It works great at home (testing server- XP machine).  When I upload the files and run it online, it fails.  The error me...

Standard Security works but Intergrated Security doesn't
I wonder if someone could help me with my problem. (btw I did go to Internet Services and I do have integrated security enabled) If I use regular login in my ConnectionString then my page works fine but if I try to use integrated security in my ConnectionString I get an error message Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. It seems like the server is not picking up my Network login to validate it against Integrated Security. Here is an excerpt from my page along with commented Integrated Security ConnectionString Dim...

Works on Client, doesn't work on Deployment server
I'm trying to deploy an application that has been tested and works fine on the client but now suddenly doesn't work on the server at all.  Its very bizarre.  If anyone has an ideas, as I'm pulling my hair out. This is the error: Server Error in '/Admin' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object ...

Web Matrix: Server won't work :(
Hi All,I am just starting with ASP.NET.I have a WinXP+SP2, .NET 1.1, ..... without IIS (hope to get it installed in a day -- I dont have access to the setup CD)I installed Web Matrix and tried -- what should have been -- my first ASP pag.I did exactly as told here:, even though the Web Matrix Server is up (as can be seen in my system tray), the IE doesnt show my page.Instead, it says:ERRORThe requested URL could not be retrieved -------------------------------------------------------------------------------- While tryin...

Acordion doesn't work on server, works fine on pc. Using Go Daddy.
Here's the code...   <cc1:Accordion ID="Accordion1" runat="server" SelectedIndex = "0" FadeTransitions = "true" FramesPerSecond ="50" TransitionDuration ="350" AutoSize ="None" HeaderCssClass = "accordionHeader" ContentCssClass ="accordionContent"> <Panes>   <cc1:AccordionPane ID="AccordionPane1" runat="server"> <Header > <a href ="" onclick ="return false;">May 25 2008</a> </Header> <Content> ...

Won't work at work!
For some reason, FF will not work on my desktop pc at work. We use Windows XP but for various reasons, they only have IE 6.0. Yuch!! So I installed Firefox After launching FF, a Windows XP authentication window pops up and requests "Enter User Name" for an unknown url at our facility, and a "Password". This window cannot be closed. I must terminate the FF process. Any help with this would be appreciated! Boatman Boatman wrote: > For some reason, FF will not work on my desktop pc at work. We use Windows > XP but for various reas...

firefox won't work w/ norton internet security
Name: r Email: bandit4444atgmaildotcom Product: Firefox Summary: firefox won't work w/ norton internet security Comments: Why won't these products work together now that I up-graded to 3.6? Can you give me the old 3.4 or 3.5 to download so I can get back to using the 2 products I like together? I can't find these older programs to download on your site so the url would be helpful! Thanks! Browser Details: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729;...

Secure Conversation doesn't work with second web service
Hi everyone I have a solution based on Secure Conversation using a Security Context Token Service (which is just a web service) that gives out SCT's, a client program gets the issued SCT. But the problem I have is can this client then hold Secure Conversations with one or a number of other web services. I have another web service the client signs and encrypts the message and attempts to send the response to the web service but I get the following error.Error "System.Security.Cryptography.CryptographicException: WSE523: The CipherData contents are invalid"I have read that much between blogs a...

Security doesn't work in administration tool after deploying to live server
I have a site which I've built using .net 3.5 in Visual Studio 2008 with SQL Server Express 2005.Everything runs fine on my local machine, including everything in the admin tool. But when I copy everything to the live server, I can't manage users with the website administration tool. It tells me:There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new...

Can't get the Web Controls to work.. The Build.Bat file doesn't work? HELP>> ARGGG>.
Hi.. I was wanting to use the IE Web Controls, the Tab Strip, etc, and play with it.. Since I have IIS 5, I thought I'd copy them there using the Read me.txt instructions and then copy to a dev server that I use at a web host.. Well, everything worked except the Build file doesn't build the Microsoft.UI.Webcontrols.DLL file? When I try to run it by double clicking on it, it runs really fast in  the DOS window, but I can't see what it says and it closes.. So I tried to do so manually and I received an error that the "cse.exe is not recognized as an internal or external command or batch...

Can't get SQL Server membership provider work in a web service
Hi!I have a web server running a web application and some web services.In the web application I use the System.Web.UI.WebControls.Login as login control; this uses the SqlMembershipProvider to validate the user.In the web services I use the System.Web.Security.Membership.ValidateUser to validate the user of the service, which also uses the SqlMembershipProvider.I have a SQL server on a different subnet where the "Membership" database is stored.When running the web application every thing works just fine, but when trying to run the web service I get error when calling System.Web.Sec...

Web Site 'worked' last week, now won't (Bank)
Hi Folks, I know residing within are some 'code' experts who've (in the past) pointed to a 'part' of a page and said, "That's why it won't work"... I've banked here ( for some time and because 'they' made 'changes' to their site I no longer can use Firefox 2.0.6. Only IE will open the dang place. Any solutions or reasons? Thanks, Doc -- "Doc" in Los Angeles mailto: On 7/31/2007 9:42 AM, Thunderbird leader Doc by teletype announced: > Hi Folks, >...

Extension Uninstaller won't work and won't uninstall itself
I have a complicated profile that I don't want to have to recreate. I'm using SM 1.0.5, and I want to uninstall all of the extensions that I've installed that don't come from Mozilla. These are my current extensions: Chatzilla 0.9.67+ Extension Manager 2.0 Extension Uninstaller API 2.0 FlashGot NoScript Roaming I want to uninstall Flashgot, Noscript, the Extension Manager and the Extension Uninstaller API; however, the Extension Manager doesn't work; it won't uninstall either Flashgot nor Noscript, and I don&...

client install doesn't work and can't uninstall client
Help! I installed Groupwise 6.5 client on a freshly formatted workstation. All seemed to go normal, except when i tried to run Groupwise i get the following... Groupwise is not properly installed. The Groupwise components could not be initialized. Please run groupwise setup, or contact your systme administrator. so i then tried to uninstall the the client and i get this... The log file "C:\windows\system32\delsl2.isu" is not valid or the data has been corrupted. Uninstallation will not continue. so i then tried to just do an install anyway, and i end up...

Web resources about - aspnetdb membership security working fine on client, won't work on web server -

Polish European Union membership referendum, 2003 - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Drivers of Facebook Shuttle Buses Eye Teamsters Membership
Facebook and several other tech companies in Silicon Valley provide shuttle buses to transport their employees, and according to The New York ...

NJ Membership (@NJMembership) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Membership Has Its Privileges
Right now, crossing one of the magical rep borders happens more or less unnoticed. People just gain the particular powers. Now, of course they ...

Membership Cards - a set on Flickr
... home Sign Up Explore Recent Photos The Commons Getty Collection Galleries World Map App Garden Camera Finder Flickr Blog Upload Sign In Membership ...

Calgary Public Library: New Look. New Library. Free Membership. - YouTube
CREATING THE WORLD’S BEST PUBLIC LIBRARY: NEW LOOK. NEW LIBRARY. FREE MEMBERSHIP. For Immediate Release: In a bold move to become the world’s ...

The benefits of private club membership in the UAE
Lifestyle membership clubs can offer cardholders exclusive leisure discounts across the Emirates. But there can be a big catch - you need to ...

New Brisbane Broncos CEO Paul White Flags Membership Drive
The coal executive taking over at the helm of the Brisbane Broncos has his eyes set on the thousands of fans who regularly turn up to home games ...

Joe Tripodi's ALP membership suspended
NSW ALP has suspended membership of Joe Tripodi amid a corruption inquiry.

Invite-only memberships expand at Canberra's sky-high lounge
... club &ndash; if they have been lucky enough to get an invite The 15th floor lounge billed as Canberra's most exclusive has quadrupled its membership ...

Resources last updated: 11/30/2015 8:43:26 PM