Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to use multiple profiles

Reply
Thread Tools

How to use multiple profiles

 
 
Peter Afonin
Guest
Posts: n/a
 
      02-27-2010
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

 
Reply With Quote
 
 
 
 
Peter Afonin
Guest
Posts: n/a
 
      03-02-2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to use multiple profiles Peter Afonin ASP .Net Security 1 03-02-2010 03:34 AM
Moz1.7.5. Multiple profiles, profiles lacking email accts crash. oops Splibbilla Firefox 0 03-21-2005 02:58 AM
Multiple profiles Darek Firefox 3 03-04-2005 08:15 PM
Possible to open multiple instances/profiles of Firefox (win32)? Isak Dinesen Firefox 2 07-27-2004 03:12 AM



Advertisments