0
votes

When I get on the Security tab on the Web Site Administration Tool, I get this Error:

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 data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database.

Here is the connectionStrings part in web.config file:

<connectionStrings>
  <add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Verkoop.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
  <add name="BestellingDBContext" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Verkoop.mdf;Integrated Security=True" />
</connectionStrings>

And here is the membership part:

<membership>
  <providers>
    <add connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
      enablePasswordReset="true" requiresQuestionAndAnswer="false"
      requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
      minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
      applicationName="/" name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </providers>
</membership>

I've been searching the internet for solution for hours now, but can't find anything. Can somebody please help? Thanks!

EDIT

roleManager tag:

<roleManager>
  <providers>
    <add connectionStringName="DefaultConnection" applicationName="/"
      name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </providers>
</roleManager>
1
question Is this a connection string for EF or a `Connection string just for a sql server database..? sounds like you need to read this it will help Connection StringsMethodMan
Could you post roleManager tag located normally right below memebrship tag in web.config?Win
When I change the connection string I get an error that the connection DefaultConecction is missing or empty.Bouss
Win, I added the roleManager tag.Bouss

1 Answers

0
votes

It can also be caused by the role manager feature not being enabled.

Error message said roleManager is not enabled. Please enable it and test it again.

<roleManager defaultProvider="DefaultRoleProvider" enabled="true">
  <providers>
    ...
  </providers>
</roleManager>