Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Membership class
Message
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01429616
Message ID:
01429624
Views:
36
>>>Hi,
>>>
>>>Do I understand correctly that System.Web.Security.Membership class get the credentials from SQL Server? The reason I am asking is I wanted to test how it works and tried to get the user name using syntax
>>>
>>>this.myTextBox.text = Membership.GetUser().UserName.ToString();
>>>
>>>
>>>But I get error something to the extend of "could not connect to SQL Server". So I wanted to be sure that the class Membership is only applicable when using SQL Server?
>>
>>No, it depends on how did you define it in web.config
>
>Here is what I found in our web.config (right after machineKey ValidationKey section and before authorization)
>
>
><profile defaultProvider="TableProfileProvider">
>			<providers>
>				<add name="TableProfileProvider" type="Microsoft.Samples.SqlTableProfileProvider" connectionStringName="Conn" table="AdminInfo" applicationName="FCAdmin"/>
>			</providers>
>			<properties>
>			<snip>
>			</properties>
>		</profile>
>		<membership defaultProvider="FCAdminMembershipSqlProvider" userIsOnlineTimeWindow="20">
>			<providers>
>				<snip>
>			</providers>
>		</membership>
>		<roleManager enabled="true" cacheRolesInCookie="true">
>			<providers>
>				<remove name="AspNetSqlRoleProvider"/>
>				<add name="AspNetSqlRoleProvider" connectionStringName="Conn" applicationName="FCAdmin" type="System.Web.Security.SqlRoleProvider"/>
>			</providers>
>		</roleManager>
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform