views:

346

answers:

2

So I need to add two new properties to the Profile object for asp.net membership.

I added these two items to the properties tag in web.config.

<group name="Terms">
  <add name="Promotions" type="Bool" serializeAs="String" />
  <add name="AcceptedTerms" type="Bool" serializeAs="string" />
</group>

In my code behind I am able to do Profile.Terms.Promotions and call Profile.Save() with no exceptions.

However, the aspnet_Profile table does not seem to have the updated properties.

Do I need to run something on the actual database, like an update script of some sort?

Thanks in advance!

Edit by Jack:

So I found out it's an issue with my development database server. For some reason Profile info is not saving properly. So this is a whole other issue ha

+2  A: 

Membership profile uses it's own method of generating a serialized profile object that represents the properties you require. On objects that have already been created in the database the new properties might not be present until they have been re-saved.

Quintin Robinson
+1  A: 

The aspnet_Profile table serializes everything as a BLOB- it doesn't add new columns. It does this because it means the DB does not need have its schema changed.

Of course you change this behaviour quite easily- here is one such article describing how to do it.

RichardOD
That's what I figured, but when I physically updated the new Profile properties and saved them, the data wasn't being captured.
Jack Marchetti
What I mean by that is on a page I called Profile.Terms.Promotions = true;Profile.Save();Came back and it was still false
Jack Marchetti