473,467 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET 2.0 Custom Profile Provider

Hello

I implemented custom profile provider based on the example at
http://msdn2.microsoft.com/en-us/library/ta63b872.aspx. It reads Profiles
values from tables in Sql Server.

Everytime when I read Profile property (e.g. string Name =
Profile.FirstName) GetPropertyValues function is called. However after this
function SetPropertyValues is also called. It does not make sense why this
method should be called even if I do not update Profile properties. It just
adds additional overhead to the database server. Does someone has an
explanation about this?

Darius


Nov 3 '06 #1
2 1658
I was having the exact same issue. What really concerned me was that
the IsDirty flag was true even though none of the property values were
modified.

According to http://www.123aspx.com/redir.aspx?res=33957 :

"...if you are storing anything besides strings, DateTime classes, or
primitive types, it becomes impossible for the ProfileModule to
determine whether the content has actually changed, and it is forced to
write the profile back to the data store every time it is retrieved."

Basically, you have to set automaticSaveEnabled="false" in your <profile
configuration in web.config and then explicitly call the Profile.Save
method when you want to save the profile information. Additionally, it
appears that you have to explicitly set IsDirty = false within the page.

This seems to work even though it's a bit clunky.

Thanks,
Glenn

Darius wrote:
Hello

I implemented custom profile provider based on the example at
http://msdn2.microsoft.com/en-us/library/ta63b872.aspx. It reads Profiles
values from tables in Sql Server.

Everytime when I read Profile property (e.g. string Name =
Profile.FirstName) GetPropertyValues function is called. However after this
function SetPropertyValues is also called. It does not make sense why this
method should be called even if I do not update Profile properties. It just
adds additional overhead to the database server. Does someone has an
explanation about this?

Darius

Nov 3 '06 #2
great stuff Glenn, I will follow your advice. Thanks a lot!
"Glenn" <gl***@foo.barwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I was having the exact same issue. What really concerned me was that the
IsDirty flag was true even though none of the property values were
modified.

According to http://www.123aspx.com/redir.aspx?res=33957 :

"...if you are storing anything besides strings, DateTime classes, or
primitive types, it becomes impossible for the ProfileModule to determine
whether the content has actually changed, and it is forced to write the
profile back to the data store every time it is retrieved."

Basically, you have to set automaticSaveEnabled="false" in your <profile
configuration in web.config and then explicitly call the Profile.Save
method when you want to save the profile information. Additionally, it
appears that you have to explicitly set IsDirty = false within the page.

This seems to work even though it's a bit clunky.

Thanks,
Glenn

Darius wrote:
>Hello

I implemented custom profile provider based on the example at
http://msdn2.microsoft.com/en-us/library/ta63b872.aspx. It reads Profiles
values from tables in Sql Server.

Everytime when I read Profile property (e.g. string Name =
Profile.FirstName) GetPropertyValues function is called. However after
this function SetPropertyValues is also called. It does not make sense
why this method should be called even if I do not update Profile
properties. It just adds additional overhead to the database server. Does
someone has an explanation about this?

Darius
Nov 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: | last post by:
Hi all, How can I get a reference to my custom profile provider in my .aspx page? I have looked at httpcontext.current.profile. But from there where do I go? Ideally I would like to be able to...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
4
by: techsupport | last post by:
I have some experience with .NET Remoting, as well as ASP.NET 2.0, and have been wanting to remote a custom membership and profile provider. I want to take advantage of the new controls in ASP.NET...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
0
by: Giorgio | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older...
0
by: Phil | last post by:
I created a custom profile provider based on the example here : http://www.theserverside.net/articles/showarticle.tss?id=CreatingProfileProvider It works ok, but when I try to get the last update...
3
by: Rich Armstrong | last post by:
I've implemented a custom profile provider following the pattern and examples provided with ASP.NET 2.0, but no Profile object ever appears in my page; that is, after executing the following, ...
0
by: Rajesh | last post by:
I am trying to use a simple custom type for saving the profile information of a user. The custom class inherits from the Hashtable. I am serializing the type as "Binary" in the provider sections of...
10
karlr
by: karlr | last post by:
OK, I know this has been discussed in multiple posts. However, I still have not seen a good example. That is, I have a custom Membership provider using the ASP.NET 2.0 controls. I am restricted...
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.