Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET Role class throwing SQL Network Interfaces, error: 26
    primarykey
    data
    text
    <p>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.</p> <p>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:</p> <p>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)</p> <p>I removed the loginview control, and tried again. Page w/o code &amp; controls loaded properly. My Next attempt was to add to the page load:</p> <pre><code>string str = Roles.GetRolesForUser("Admin").First(); </code></pre> <p>This resulted in the same error, I have since reverted my page back to the no code behind and one loginview control.</p> <p>I'm not sure why the Role class cannot access the database but the membership class can.</p> <p>Here is my web.config, which I suspect is where the problem lies</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --&gt; &lt;configuration&gt; &lt;location path="~/Admin.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager,Supervisor" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Machines.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Workcenters.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Procedure.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager,Supervisor" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Users.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Manager" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Section.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Admin_Tensile.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow roles="Admin,Maintainer,Manager" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;location path="~/Procedures"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow users="*" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;system.web&gt; &lt;roleManager enabled="true" /&gt; &lt;authentication mode="Forms" /&gt; &lt;membership defaultProvider="myProvider"&gt; &lt;providers&gt; &lt;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="" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt; &lt;add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /&gt; &lt;/assemblies&gt; &lt;buildProviders&gt; &lt;add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" /&gt; &lt;/buildProviders&gt; &lt;/compilation&gt; &lt;/system.web&gt; &lt;connectionStrings&gt; &lt;!--Home/School connection(SQLSERVER 2008 R2--&gt; &lt;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=&amp;quot;data source=.;initial catalog=QUALITY.MDF;user id=sa;password=****;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; &lt;add name="userdb" connectionString="Data Source=.;Initial Catalog=ASPNETDB;uid=sa;Password=****" /&gt; &lt;!--Work Connection(SQLEXPRESS)--&gt; &lt;!--&lt;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=&amp;quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Quality.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;--&gt; &lt;!--&lt;add name="userdb" connectionString="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ASPNETDB.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;" /&gt;--&gt; &lt;/connectionStrings&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload