[01/28/2009]
I spent a terrible amount of time on this walkthrough, in part possibly because I clicked on the "Configuring an ASP.NET Application to Use Membership" link which may have caused me to do one thing that was fatal to my progress. Additionally, when I started this walkthrough I had SQL Server 2005 on my machine as well as SQL Server Express 2008, and I don't know if that played into my problems, since I removed it before I was finally able to get this walkthrough project to run successfully.
If I had known the following was the connection string that worked and that I shouldn't have left this page if I had IIS installed, I think I wouldn't have had any problems. But I think something had me remove User Instance, which caused me to get hung up on aspnetdb, aspnet_regsql.exe, the database not attaching, the database being read only...and generally going through what seemed like every page on Google trying to figure out why things weren't working. The connection string has to be correct before you click on ASP.NET Configuration in the "To create a membership user" section; to correct it later leaves you with a mess of problems.
Put this in your web.config, or check the string in your machine config (minus the "remove" statement) and you won't have to worry about whether the string is correct if you are using Windows authentication:
<
connectionStrings>
<
remove name="LocalSqlServer"/>
<
add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|aspnetdb.mdf;Integrated Security=SSPI;User Instance=true" providerName="System.Data.SqlClient" />
</
connectionStrings>
It may well be that the default statement is correct in the machine.config file. The lines above are slightly mangled by the editor.
After a day and a half of banging my head against the wall trying to make this work with no end in sight I trashed this walkthrough in a rating. But if I didn't have whatever problem(s) I had, it would have been a very enjoyable walkthrough. [update] But after running it successfully for a day I decided to link to the infamous aspnetdb database using MS Access and presto, my application was cast into *** again because of database issues, and not simple DB issues either. This is totally not for newbies and is extremely brittle, making it not friendly for anyone with the info MSFT has put out. These issues have gone on for years and there are no clean-looking clues for solving them. What is happening is really funky and not articulated, so you are dealing with a black box. I certainly give MSFT an F on this. But I do know how to cure my immediate problem: I just have to create a new project and do all the ASP.net configuration stuff all over again and copy my files into that new project. But, wait! There's more! People have had tons of problems moving this to a real server environment!
Good luck.