Custom Profile Provider

F

Frijoles

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
 
D

Dominick Baier [DevelopMentor]

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top