Can you use the aspnetdb with 2 web sites

I host a web site WEBSITEA that you login  using the aspnetdb database. I now need to host a second web site WEBSITEB that you login using the same login ID and password that you use for WEBSITEA. Is it possible to share the same aspnetdb database with both sites and how do I do that? I am using visual studio 2008
whiwexAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
Yes, you can share the aspnetdb. Your membership/roles/profiles settings in your web.config should be same for WebsiteA and WebsiteB.
0
whiwexAuthor Commented:
This is what I have under Membership for both web sites. I don't see a profiles

<membership>
                  <providers>
                        <remove name="AspNetSqlMembershipProvider"></remove>
                        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
                  </providers>
            </membership>
0
guru_samiCommented:
If you are not using roles or profiles, that's fine.
Make sure both of your web.config has same settings for the following:
- Membership provider
- The LocalSqlServer connection string pointing to the same aspnetdb
- MachineKey (if any)
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

whiwexAuthor Commented:
I am using roles but the roles are the same on both web sites.
The aspnetdb file is in the app_data folder in both web sites. WebsiteA has the current user names and passwords and has the above paste membership settings. WebsiteB is new and needs to use the same usernames and passwords as websiteA.

I figure that I have to set the config file in WebsiteB to point to the aspnetdb file in websiteA.
I just don't know how to.

Thanks
0
guru_samiCommented:
Ok you won't be able to share the aspnetdb directly from app_data folder.
You will have to put the attach the aspnetdb.mdf to an SqlExpress or Sql Server instance.

Check these:
- http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
- http://www.serverintellect.com/support/sqlserver/sql-database-attach/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
whiwexAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.