I am using the default Sitemap provider with secutiry trimming. But, some how, I get:
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
I’m thinking the sitemap provider is looking for the roles in the wrong place. My configuration is like this:
<connectionStrings>
<add name="DB" ... />
</connectionStrings>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="SqlProvider" .../>
</providers>
</membership>
<roleManager enabled="true">
<providers>
<add connectionStringName="DB" type="System.Web.Security.SqlRoleProvider" ... />
</providers>
</roleManager>
The Sitemap tag is defined like this:
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true" >
<providers>
<clear/>
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider "
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
Why am I getting the sql error? How does the trimming get the roles?
EDIT:

The core error from your screenshot is
unfortunatly, this is truncated. The message would normally then continue with ” is configured to allow remote connections.“, and this may further be followed by a specific reason (for example, it may state (amongst various other reasons) “provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified”)
However, with the message you have so far, it looks like a connectivity problem between the client machine and the SQL Server box. So I’d look at doing due-diligence against the SQL Server box and network connectivity first:
If they pass then you need to validate than you can log-on. I’d normally use the SQL management tools, especially the command line tool
sqlcmdto test basic connectivity (for example:sqlcmd -E -S mysqlserver\instanceto connecto to the default database orsqlcmd -E -S mysqlserver\instance -d databaseto connect to a specific database). Obviously you’ll need to run these as the user that your web application is running as, otherwise they’ll attempt to authenticate as you (either userunasor start a command prompt under different credentials [find a command prompt in the start menu then, shift-right-click -> “Run as a different user].However what would ultimately help would be if you can get the full error message text (rather than the truncated version), then that may help narrow down the specific problem you’re having.