I am setting up a membership provider, and as a result, I am getting the following error message:
An attempt to attach an auto-named database for file
C:\Users\Mcoroklo\Desktop\Programmering\Private Projekter\ASP.NET\Helpdesk\Version4\HelpDesk\ClientSite\App_Data\ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I am new to setting up membership so I can't deny something really crucial is missing! :-)
I am quite sure this has something to do with my connection string and/or SQL Membership provider. I've the following setup in my web.config:
My connection string:
<connectionStrings>
<add name="MembershipServer" connectionString="Server=.\SQLExpress;AttachDbFilename=|DataDirectory|\ASPNETDB.mdf; Trusted_Connection=Yes;"/>
My SQL provider
<membership defaultProvider="AspNetSqlProvider">
<providers>
<clear/>
<add connectionStringName="MembershipServer"
name="AspNetSqlProvider"
applicationName="/"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
My authentication and authorization:
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="Site/Login.aspx"
cookieless="UseCookies" >
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
The file structure in my website is I've two local databases in my directory. The membership one (ASPNETDB.MDF) is the one i point at with my connection string. I've used the ASP.NET tool to create it.
The other database I connect to via LINQ TO SQL classes and is in a different project (using tier layers).
Thanks a bunch!!