Custom Profile Provider

Discussion in 'ASP .Net Security' started by Frijoles, Feb 28, 2006.

  1. Frijoles

    Frijoles Guest

    I'm working against an Oracle database, trying to implement a custom profile
    provider. I have the membership and roles providers working, and in fact I
    can get the profile provider to work as well. I'm wondering, however, how
    this works logically.

    It seems that when I add an new property to my web.config file, it picks
    that up correctly in the application. However, unless I implement that in the
    profile provider, it will not work. It seems a bit useless, then, that for
    every property in the web.config section, I have to set up multiple functions
    (get/set) for that property to work correctly. The end result is a lot of
    extra code. I can't see a way to do a mass-update of all the data at one time.

    Also, the custom provider from the MSDN website actually deletes the data
    from profiledata table, and then does an insert to put the data back. The
    result of the default code, then, is that:

    Profile.FirstName = "bob";
    Profile.LastName = "marley";
    Profile.Save();

    This results in only 'marley' being saved. Bob is lost due to the deletion.
    I've modified the code to update instead of delete, but I still have the
    problem above.. for every new field I add, I have to modify my provider to
    handle it. Surely there is a better way to what I am doing? I'd hate to have
    to hit the database dozens of times whenever I want to update a user's record.

    Aaron
     
    Frijoles, Feb 28, 2006
    #1
    1. Advertising

  2. Hi,

    thats prolly why the built-in provider does not care about fields but serializes
    all data in a single string. If your provider is so tightly coupled to the
    actual layout of your profile data, i wonder if a provider makes sense at
    all. Maybe a for your needs tailored library makes much sense.

    Don't do providers for providers sake.

    That said - there is a sample profile provider implementations from MS that
    store data in separate fields...
    http://weblogs.asp.net/scottgu/archive/2006/01/10/435038.aspx

    Haven't looked at it - but maybe their code gives you pointers in the right
    direction.

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I'm working against an Oracle database, trying to implement a custom
    > profile provider. I have the membership and roles providers working,
    > and in fact I can get the profile provider to work as well. I'm
    > wondering, however, how this works logically.
    >
    > It seems that when I add an new property to my web.config file, it
    > picks that up correctly in the application. However, unless I
    > implement that in the profile provider, it will not work. It seems a
    > bit useless, then, that for every property in the web.config section,
    > I have to set up multiple functions (get/set) for that property to
    > work correctly. The end result is a lot of extra code. I can't see a
    > way to do a mass-update of all the data at one time.
    >
    > Also, the custom provider from the MSDN website actually deletes the
    > data from profiledata table, and then does an insert to put the data
    > back. The result of the default code, then, is that:
    >
    > Profile.FirstName = "bob";
    > Profile.LastName = "marley";
    > Profile.Save();
    > This results in only 'marley' being saved. Bob is lost due to the
    > deletion. I've modified the code to update instead of delete, but I
    > still have the problem above.. for every new field I add, I have to
    > modify my provider to handle it. Surely there is a better way to what
    > I am doing? I'd hate to have to hit the database dozens of times
    > whenever I want to update a user's record.
    >
    > Aaron
    >
     
    Dominick Baier [DevelopMentor], Feb 28, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2V0ZG90bmV0?=

    Custom profile provider asp.net 2.0

    =?Utf-8?B?Z2V0ZG90bmV0?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    574
    =?Utf-8?B?Z2V0ZG90bmV0?=
    Jul 6, 2005
  2. Guest
    Replies:
    2
    Views:
    1,804
    Steven Cheng[MSFT]
    Nov 14, 2005
  3. Replies:
    5
    Views:
    2,441
    abuShousheh
    Sep 12, 2008
  4. =?Utf-8?B?UGhpbA==?=

    Custom Profile Provider giving error on LastUpdatedDate

    =?Utf-8?B?UGhpbA==?=, Feb 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    469
    =?Utf-8?B?UGhpbA==?=
    Feb 13, 2006
  5. =?Utf-8?B?UmljaCBBcm1zdHJvbmc=?=

    Custom Profile provider is null

    =?Utf-8?B?UmljaCBBcm1zdHJvbmc=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    464
    Steven Cheng[MSFT]
    May 4, 2006
Loading...

Share This Page