English 中文(简体)
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.

问题回答

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.





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签