Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the PropertyValuesString and PropertyValuesBinary fields in the aspnet_Profiles table for?

I figured the PropertyValuesString was for the value part of what is usually the Key-Value pair of these types of object. But then where does the PropertyValuesBinary field come in if you've already put the value into the PropertyValuesString?

Both fields are non-nullable so I need something to put in each. What's the difference between the two and what should I be putting in them?

Also, I was wondering why it's plural -- PropertyValues -- doesn't really make sense again with the whole key-value pair thing, I figured one property should have one value.

like image 849
Matt Avatar asked Jan 22 '23 20:01

Matt


1 Answers

SqlProfileProvider persists profile properties in three fields of the aspnet_Profile table: PropertyNames, PropertyValuesString, and PropertyValuesBinary. The following is a synopsis of what's stored in each field:

  • PropertyNames holds a string value containing information about the profile property values present in the PropertyValuesString and PropertyValuesBinary fields. The string holds a colon-delimited list of items; each item denotes one property value, and it is encoded in the following format: Name:B|S:StartPos:Length

    • Name is the property value's name.
    • The second parameter, which is either B (for "binary") or S (for "string"), indicates whether the corresponding property value is stored in the PropertyValuesString field (S) or the PropertyValuesBinary field (B).
    • StartPos and Length indicate the starting position (0-based) of the corresponding property value within these fields, and the length of the data, respectively. A length of -1 indicates that the property is a reference type, and that its value is null.
  • PropertyValuesString stores profile property values persisted as strings. This includes property values serialized by the .NET Framework's XML serializer, and property values serialized using string type converters. The "S" values in the PropertyNames field contain the offsets and lengths needed to decompose PropertyValuesString into individual property values.

  • PropertyValuesBinary stores profile property values persisted in binary format—that is, profile properties that were serialized using the .NET Framework's binary serializer. The "B" values in the PropertyNames field contain the offsets and lengths needed to decompose PropertyValuesBinary into individual property values.

Note that profile providers are not required to persist data in this format or any other format. The format in which profile data is stored is left to the discretion of the person or persons writing the provider.

original link for more info :http://msdn.microsoft.com/en-us/library/aa478953.aspx hope this helps.

like image 184
ali62b Avatar answered Mar 23 '23 00:03

ali62b