|
|
|
start date: Sun, 19 Aug 2007 10:46:04 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
GaryDean am
|
|
2
sloan
|
|
3
(Steven Cheng[MSFT])
|
|
4
sloan
|
SQL Membership Provider Problem
My ASP.Net application, that uses the SQL Membership Provider, runs fine on
my development box (server2003) as long as I use the standard provider.
But, in anticipation of deployment to other servers I am attempting to
register another provider instance.
I'm not sure this is the right deployment choice but I haven't found any
guidelines on how to best deploy apps using the SQL Membership provider.
I first attached C:\Inetpub\wwwroot\PTPEmployment\App_Data\ASPNETDB.MDF to
my local SQL Server instance and renamed the data base to PTPSecurity
(because that's a shorter name).
I then added the following to my web.config....
a connection string in the connection strings section.....
<add name="AUTHConnectionString" connectionString="Data
Source=DEVSERVER2003;Initial Catalog=PTPSecurity;Integrated Security=True"
providerName="System.Data.SqlClient"/>
and.....
<membership defaultProvider="SqlProvider">
<providers>
<clear />
<add connectionStringName="AUTHConnectionString" applicationName="/"
name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" />
</providers>
</membership>
Now, the applications runs for some things and the asp.net website
configuration utility will run for some things. But both also get the
following error with some things withing the provider database are accessed.
For instance if I try to access roles in either the application or the
utility I get the error pasted below.
#1 can anyone tell my why this is happening and #2 how are we supposed to
deploy apps with the ASPNETDB.MDF database?
The following message may help in diagnosing the problem: Cannot open user
default database. Login failed. Login failed for user
'DEVSERVER2003\Administrator'. 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)
thanks,
Gary
Date:Sun, 19 Aug 2007 10:46:04 -0700
Author:
|
Re: SQL Membership Provider Problem
http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
<configuration>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data
Source=localhost;Initial Catalog=appservicesdb;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
"GaryDean" <GaryDean@newsgroups.nospam> wrote in message
news:udEhPho4HHA.5844@TK2MSFTNGP02.phx.gbl...
> My ASP.Net application, that uses the SQL Membership Provider, runs fine
> on my development box (server2003) as long as I use the standard provider.
> But, in anticipation of deployment to other servers I am attempting to
> register another provider instance.
>
> I'm not sure this is the right deployment choice but I haven't found any
> guidelines on how to best deploy apps using the SQL Membership provider.
>
> I first attached C:\Inetpub\wwwroot\PTPEmployment\App_Data\ASPNETDB.MDF to
> my local SQL Server instance and renamed the data base to PTPSecurity
> (because that's a shorter name).
>
> I then added the following to my web.config....
>
> a connection string in the connection strings section.....
> <add name="AUTHConnectionString" connectionString="Data
> Source=DEVSERVER2003;Initial Catalog=PTPSecurity;Integrated Security=True"
> providerName="System.Data.SqlClient"/>
>
> and.....
> <membership defaultProvider="SqlProvider">
> <providers>
> <clear />
> <add connectionStringName="AUTHConnectionString" applicationName="/"
> name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" />
> </providers>
> </membership>
>
> Now, the applications runs for some things and the asp.net website
> configuration utility will run for some things. But both also get the
> following error with some things withing the provider database are
> accessed. For instance if I try to access roles in either the application
> or the utility I get the error pasted below.
>
> #1 can anyone tell my why this is happening and #2 how are we supposed to
> deploy apps with the ASPNETDB.MDF database?
>
> The following message may help in diagnosing the problem: Cannot open user
> default database. Login failed. Login failed for user
> 'DEVSERVER2003\Administrator'. 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)
>
> thanks,
> Gary
>
Date:Sun, 19 Aug 2007 16:19:28 -0400
Author:
|
Re: SQL Membership Provider Problem
Hi Sloan,
From Gary's initial message, it seems he has registered a new membership
provider entry and use its own connectionstring, therefore, I don't think
the problem is caused by the default "LocalSqlServer" connection string.
How do you think?
Hi Gary,
At the end of your last message, you said that the problem just occur when
you try accessing roles (in both code or the admin site page), I think the
problem is likely caused by the "Role manager" provider setting. For
ASP.NET 2.0 membership &role manager service, they use separate provider,
one for membership(user accounts) and another for role manager(for roles).
In your message, I think what you've changed is the default provider for
the membership service, you may still need to override the "role manager"
setting so as to make it also use your new SQL server standard instance and
database.
Here are some web articles mentioned the configuration for Rolemanager
provider, you can try customize your role provider setting acorrding to it:
#providers Element for roleManager (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/ms164661.aspx
#Membership and Role Providers in ASP.NET 2.0 Part II
http://www.odetocode.com/Articles/428.aspx
#How To: Use Role Manager in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms998314.aspx
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 20 Aug 2007 04:03:39 GMT
Author:
|
Re: SQL Membership Provider Problem
Ahh.
Yeah. You have to "override" the defaults for both the Membership and Roles
provider.
..........
Also check the "integrated security" issue, with the mdf.
Source=DEVSERVER2003;Initial Catalog=PTPSecurity;Integrated Security=True"
And make sure you know which account the webpage is running under, aka, if
that account has privs on that particuliar database.
Gary, did you get your issue resolved?
"Steven Cheng[MSFT]" wrote in message
news:4TMKe8t4HHA.4200@TK2MSFTNGHUB02.phx.gbl...
> Hi Sloan,
>
> From Gary's initial message, it seems he has registered a new membership
> provider entry and use its own connectionstring, therefore, I don't think
> the problem is caused by the default "LocalSqlServer" connection string.
> How do you think?
>
> Hi Gary,
>
> At the end of your last message, you said that the problem just occur when
> you try accessing roles (in both code or the admin site page), I think the
> problem is likely caused by the "Role manager" provider setting. For
> ASP.NET 2.0 membership &role manager service, they use separate provider,
> one for membership(user accounts) and another for role manager(for roles).
> In your message, I think what you've changed is the default provider for
> the membership service, you may still need to override the "role manager"
> setting so as to make it also use your new SQL server standard instance
> and
> database.
>
> Here are some web articles mentioned the configuration for Rolemanager
> provider, you can try customize your role provider setting acorrding to
> it:
>
> #providers Element for roleManager (ASP.NET Settings Schema)
> http://msdn2.microsoft.com/en-us/library/ms164661.aspx
>
> #Membership and Role Providers in ASP.NET 2.0 Part II
> http://www.odetocode.com/Articles/428.aspx
>
> #How To: Use Role Manager in ASP.NET 2.0
> http://msdn2.microsoft.com/en-us/library/ms998314.aspx
>
> Hope this helps.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Date:Tue, 21 Aug 2007 15:22:42 -0400
Author:
|
|
|