Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Custom Profile Provider

Reply
Thread Tools

Custom Profile Provider

 
 
Frijoles
Guest
Posts: n/a
 
      02-28-2006
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
 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      02-28-2006
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/archi...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
>



 
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
How to Remote a custom membership or profile provider ??? techsupport@broadport.com ASP .Net 5 09-11-2008 11:43 PM
Custom Profile provider is null =?Utf-8?B?UmljaCBBcm1zdHJvbmc=?= ASP .Net 3 05-04-2006 09:45 AM
Custom Profile Provider giving error on LastUpdatedDate =?Utf-8?B?UGhpbA==?= ASP .Net 0 02-13-2006 05:10 AM
reference to custom profile provider ASP .Net 2 11-14-2005 03:09 PM
Custom profile provider asp.net 2.0 =?Utf-8?B?Z2V0ZG90bmV0?= ASP .Net 0 07-06-2005 07:45 PM



Advertisments
 



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