I'm trying to configure ASP.NET2 Membership/roles/profiles and so on, to use a remote MSSQL 2005 server. I ran the aspnet_regsql.exe and it created the tables succesfully.
When I fire up the ASP.NET Configuration Manager and trying to create the first user, I get the following error:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem:
Unable to connect to SQL Server database. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at
ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs
e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Just to check, but did you provide the same Sql connection info to aspnet_regsql that you're specifying in your connection string? I'm asking because if you did, this eliminates any remote connectivity issues plus it's good to know that we're still targeting
the same database.
I suspect the Sql Server targetd by the ASP.NET configuration tool isn't what you expect. Can you double check the web.config for your site and see if it's still the same as what you've quoted in your post?
Thanks,
Mark
This posting is provided "AS IS" with no warranties, and confers no rights.
Just to check, but did you provide the same Sql connection info to aspnet_regsql that you're specifying in your connection string? I'm asking because if you did, this eliminates any remote connectivity issues plus it's good to know that we're still targeting
the same database.
I suspect the Sql Server targetd by the ASP.NET configuration tool isn't what you expect. Can you double check the web.config for your site and see if it's still the same as what you've quoted in your post?
It's exactly the same - I just checked :(
Any ideas?
Let's remove the ASP.NET configuration tool from the equation.
Can you create a simple aspx page for your site which just calls "Membership.DeleteUser("foo");"?
If this doesn't work, then we know there's something wrong with the web.config used by your site or there's some configuration issue with the remote database. If it does work, then there's likely an issue with the ASP.NET configuration tool.
Thanks,
Mark
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi
I have enocountered the same problem (I can say that the context is even stranger).
Using the Asp.Net Configuration Tool I am able to create manage users (create/edit/delete), but when it comes to roles, I get a similar error:
"The following message may help in diagnosing the problem:
Unable to connect to SQL Server database. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at
ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs
e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)" Also when connecting to the Security Tab it takes some time (and to SQL server is easily accesible from other applications). I have tried this for a few different applications, and got the same result.
The section in web.config regarding authentication and membership looks like:
Hi again.
I've found out (with some help - softer was nice to show me) that you should add also a provider for roles. Same goes for Providers.
<roleManager enabled="true" defaultProvider="SqlRoleProvider">
<providers>
<clear/>
<add name="SqlRoleProvider" applicationName="TestItAll" connectionStringName="aspnetdbConnectionString"
type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
Hope that this will help.
TJakobsen
Member
96 Points
52 Posts
Membership with remote SQL database - Error.
Apr 03, 2006 08:52 AM|LINK
In my root web.config I got the following:
<connectionStrings>
<add name="webhotel" connectionString="Data Source=127.0.0.2; user id=XXX; password=XXX; Initial Catalog=XXX;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true" />
<compilation debug="false" />
<authentication mode="Forms" />
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="webhotel"
applicationName="MyApplication"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
</system.web>
When I fire up the ASP.NET Configuration Manager and trying to create the first user, I get the following error:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Any suggestions?
Thanks in advance.
Tommy Jakobsen
markberr
Participant
1148 Points
239 Posts
Microsoft
Re: Membership with remote SQL database - Error.
Apr 03, 2006 07:35 PM|LINK
Just to check, but did you provide the same Sql connection info to aspnet_regsql that you're specifying in your connection string? I'm asking because if you did, this eliminates any remote connectivity issues plus it's good to know that we're still targeting the same database.
I suspect the Sql Server targetd by the ASP.NET configuration tool isn't what you expect. Can you double check the web.config for your site and see if it's still the same as what you've quoted in your post?
Mark
This posting is provided "AS IS" with no warranties, and confers no rights.
TJakobsen
Member
96 Points
52 Posts
Re: Membership with remote SQL database - Error.
Apr 05, 2006 03:55 PM|LINK
It's exactly the same - I just checked :(
Any ideas?
markberr
Participant
1148 Points
239 Posts
Microsoft
Re: Membership with remote SQL database - Error.
Apr 07, 2006 04:08 PM|LINK
Let's remove the ASP.NET configuration tool from the equation.
Can you create a simple aspx page for your site which just calls "Membership.DeleteUser("foo");"?
If this doesn't work, then we know there's something wrong with the web.config used by your site or there's some configuration issue with the remote database. If it does work, then there's likely an issue with the ASP.NET configuration tool.
Mark
This posting is provided "AS IS" with no warranties, and confers no rights.
Tudor Dumitr...
Member
10 Points
2 Posts
Re: Membership with remote SQL database - Error.
Aug 08, 2006 07:26 PM|LINK
I have enocountered the same problem (I can say that the context is even stranger).
Using the Asp.Net Configuration Tool I am able to create manage users (create/edit/delete), but when it comes to roles, I get a similar error:
"The following message may help in diagnosing the problem: Unable to connect to SQL Server database. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"
Also when connecting to the Security Tab it takes some time (and to SQL server is easily accesible from other applications). I have tried this for a few different applications, and got the same result.
The section in web.config regarding authentication and membership looks like:
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="aspnetdbConnectionString"
applicationName="TestItAll" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true"
requiresUniqueEmail="true" passwordFormat="Hashed"/>
</providers>
</membership>
The connectionString is the same with another app which is working fine.
Best Regards
Tudor Dumitriu
Tudor Dumitr...
Member
10 Points
2 Posts
Re: Membership with remote SQL database - Error.
Aug 09, 2006 08:53 PM|LINK
I've found out (with some help - softer was nice to show me) that you should add also a provider for roles. Same goes for Providers.
<roleManager enabled="true" defaultProvider="SqlRoleProvider">
<providers>
<clear/>
<add name="SqlRoleProvider" applicationName="TestItAll" connectionStringName="aspnetdbConnectionString"
type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
Hope that this will help.
Tudor Dumitriu