Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   How to use multiple profiles (http://www.velocityreviews.com/forums/t716268-how-to-use-multiple-profiles.html)

Peter Afonin 02-27-2010 10:36 PM

How to use multiple profiles
 
Hello,

I need to retrieve the user data from the different web application. In the
web.config I can specify different profiles, but I cannot figure out how can
I use it in the application. This is what I did:

<profile defaultProvider="i90PartnerProfileProvider">
<providers>
<clear/>
<add name="i90PartnerProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="i90Partner"/>
<add name="i90ProfileProvider"
type="System.Web.Profile.SqlProfileProvider" connectionStringName="i90"/>

</providers>

<properties>
<group name="AddInfo">
<add name="FirstName" type="System.String"/>
<add name="LastName" type="System.String"/>
<add name="CompanyName" type="System.String"/>
<add name="Country" type="System.String"/>
<add name="City" type="System.String"/>
<add name="Email2" type="System.String"/>
<add name="Encoding" type="System.String"/>
<add name="IP" type="System.String"/>
</group>
</properties>
</profile>

On this page I need to use the i90ProfileProvider which is not a default
provider and retrieves the data from a different SQL database using a
different connection string (i90).

I know that I can assign different providers to the login control, for
instance, but how can I retrieve the user data using C# or VB? I've tried to
play with the MembershipProvider class and some other classes - couldn't
figure this out.

I would appreciate your help.

Thank you,

Peter


Peter Afonin 03-02-2010 03:34 AM

Re: How to use multiple profiles
 
I have figured out how to get a user using the non-default provider:

MembershipUser user=
Membership.Providers["providername"].GetUser("username",false);

Now all I need is to figure out how to tell the application to use the
non-default Profile provider, in my case, "i90ProfileProvider".

I thought this would be much easier than it is.

"Peter Afonin" <petera@gudzon.net> wrote in message
news:E29C6EA2-05EA-48D6-8557-991B0A8E6B76@microsoft.com...
> Hello,
>
> I need to retrieve the user data from the different web application. In
> the web.config I can specify different profiles, but I cannot figure out
> how can I use it in the application. This is what I did:
>
> <profile defaultProvider="i90PartnerProfileProvider">
> <providers>
> <clear/>
> <add name="i90PartnerProfileProvider"
> type="System.Web.Profile.SqlProfileProvider"
> connectionStringName="i90Partner"/>
> <add name="i90ProfileProvider"
> type="System.Web.Profile.SqlProfileProvider" connectionStringName="i90"/>
>
> </providers>
>
> <properties>
> <group name="AddInfo">
> <add name="FirstName" type="System.String"/>
> <add name="LastName" type="System.String"/>
> <add name="CompanyName" type="System.String"/>
> <add name="Country" type="System.String"/>
> <add name="City" type="System.String"/>
> <add name="Email2" type="System.String"/>
> <add name="Encoding" type="System.String"/>
> <add name="IP" type="System.String"/>
> </group>
> </properties>
> </profile>
>
> On this page I need to use the i90ProfileProvider which is not a default
> provider and retrieves the data from a different SQL database using a
> different connection string (i90).
>
> I know that I can assign different providers to the login control, for
> instance, but how can I retrieve the user data using C# or VB? I've tried
> to play with the MembershipProvider class and some other classes -
> couldn't figure this out.
>
> I would appreciate your help.
>
> Thank you,
>
> Peter




All times are GMT. The time now is 07:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57