Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9151745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:52:38+00:00 2026-06-17T11:52:38+00:00

My Home computer is running Visual Studio 2012 and SQL Server 2008 R2. This

  • 0

My Home computer is running Visual Studio 2012 and SQL Server 2008 R2. This website has been working on my work computer running VWD10/SQLEXPRESS. I can access and run all pages but my admin.aspx page.

After logging in successfully, I click on my Admin,aspx page, which only has one loginview control and no code behind. The website hangs then I get the error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

I removed the loginview control, and tried again. Page w/o code & controls loaded properly.
My Next attempt was to add to the page load:

string str = Roles.GetRolesForUser("Admin").First();

This resulted in the same error, I have since reverted my page back to the no code behind and one loginview control.

I’m not sure why the Role class cannot access the database but the membership class can.

Here is my web.config, which I suspect is where the problem lies

    <?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <location path="~/Admin.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager,Supervisor" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Machines.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Workcenters.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Procedure.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager,Supervisor" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Users.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Section.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Admin_Tensile.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin,Maintainer,Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/Procedures">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  <system.web>
    <roleManager enabled="true" />
    <authentication mode="Forms" />
    <membership defaultProvider="myProvider">
      <providers>
        <add name="myProvider"  type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        connectionStringName="userdb" enablePasswordRetrieval="false" 
        enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" 
        requiresUniqueEmail="True" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
        minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
        passwordStrengthRegularExpression="" />
      </providers>
    </membership>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
      <buildProviders>
        <add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
      </buildProviders>
    </compilation>
  </system.web>
  <connectionStrings>
    <!--Home/School connection(SQLSERVER 2008 R2-->
    <add name="QualityEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=QUALITY.MDF;user id=sa;password=****;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="userdb" connectionString="Data Source=.;Initial Catalog=ASPNETDB;uid=sa;Password=****" />
    <!--Work Connection(SQLEXPRESS)-->
    <!--<add name="QualityEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Quality.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />-->
    <!--<add name="userdb" connectionString="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ASPNETDB.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;" />-->
  </connectionStrings>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:52:40+00:00Added an answer on June 17, 2026 at 11:52 am

    So the problem was that I was not defining the role provider, so it was using the sqlexpress roleprovider. My home computer did not have sqlexpress, which is why the database worked on my work computer and not my home computer. The reason I could login was that I had configured a membership provider.

    to fix the problem I changed

    <roleManager enabled="true" />
    

    to

    <roleManager defaultProvider="myRoleProvider" enabled="true">
      <providers>
        <clear/>
        <add
          name="myRoleProvider"
          type="System.Web.Security.SqlRoleProvider"
          connectionStringName="userdb"
          applicationName="/" />
      </providers>
    </roleManager>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a single computer with Windows7 Home Premium running with SQL Server 2008
I have been studying computer vulnerabilities and have been working on this problem for
I have a 2nd computer that I've installed Microsoft SQL Server 2008 Express on.
I am running Aprelium Abyss Web Server from my home computer and I have
I just installed VisualSVN server yesterday at my home computer and I can access
I have an account at a server at school, and a home computer that
I am running Visual Studio 2010 on a Windows 7 virtual machine inside of
At work, I have a desktop computer running Ubuntu 11.04 with VirtualBox installed. I
I installed Cilk successfully on my home computer, a 32-bit machine running Ubuntu. I
I installed DevExpress v2011 vol 1 on my Win7-32 Home Premium computer running Microsoft

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.