title: Unable to establish a connection to a database of SQL Server
body: <p>When connecting to SQL Server error occurred with the network or to a specific instance</p>
  
  <pre>
  The server was not found or is not available.
  Verify that the instance name is spelled correctly 
  and that SQL Server allow remote connections. 
  
  provider: SQL Network Interfaces, error: 26 - 
  Error detection specified server or instance.
  </pre>
  
  <p>The connection string to the database: </p>
  
  <pre><code>&lt;add name="RequirementContext" 
      connectionString="Data Source=RU-DEV24;Initial Catalog=OpenSoft.AgileAnalytics.EF;Integrated Security=True;MultipleActiveResultSets=True"
      providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>I can not understand, which is why this error occurs. Help please!</p>
  
  <p>Code in which an error</p>
  
  <pre><code>public class Permission
      {
          public string RoleString
          {
              get
              {
                  return string.Join(", ", UserRoles);
              }
          }
  
          public int UserId { get; set; }
  
          public string UserName { get; set; }
  
          public List&lt;string&gt; UserRoles { get; set; }
  
          public static Permission CreateFromUserProfile(UserProfile userProfile)
          {
              //here
              return new Permission
              {
                  UserId = userProfile.UserId,
                  UserName = userProfile.UserName,
                  UserRoles = Roles.GetRolesForUser(userProfile.UserName).ToList(),
              };
          }
      }
  </code></pre>
  
  <p><strong>!!!!
  The problem was solved. I just added to file web.config this code:</strong></p>
  
  <pre><code>&lt;roleManager enabled="true" defaultProvider="SimpleRoleProvider"&gt;
        &lt;providers&gt;
          &lt;clear /&gt;
          &lt;add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider,WebMatrix.WebData" /&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
      &lt;membership defaultProvider="SimpleMembershipProvider"&gt;
        &lt;providers&gt;
          &lt;clear /&gt;
          &lt;add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" /&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
  </code></pre>