locked
aspnet membership database RRS feed

  • Question

  • we are using aspnet membership database, in aspnet_prifile table, there is a field called property name and propertyvalues binary.

    we are storing all of the user attributes like name, email, phone, etc in the column propertyvalues binary.

    the propertyname colimn has a column values  somehing like this Item:B:0:530:

    i want to be able read the user attributes through the propertvaluesbinary column(it has all the attribute values for a given user).

    please somene give me suggetions on how to get the user attributes.

     

    thanks for any response.

    nik

    • Moved by Bob Beauchemin Thursday, July 8, 2010 9:04 PM This would be best in an ASP.NET forum, no access to those, so moving it to (hopefully) most on-topic forum (From:.NET Framework inside SQL Server)
    Thursday, July 8, 2010 8:57 PM

All replies

  • I believe you have to use the Profile class.

    ProfileCommon p = Profile.GetProfile("xxx");

    txtName.Text = p.FirstName + " " + p.LastName;

    txtEmail.Text = p.Email;

    ...

    Tuesday, July 13, 2010 8:10 PM
  • without using asp, i want to be able to retrieve from sql server.

     

    any way to do that using CLR or something

     

    thnks

     

    nik

    Tuesday, July 13, 2010 10:55 PM
  • I haven't tried it, but can you try SELECT sys.fn_sqlvarbasetostr(<column>) FROM <table>

    That should return the binary as a string and then you can work from that.

    Wednesday, July 14, 2010 7:01 PM
  • the propertyname colimn has a column values  somehing like this Item:B:0:530:

    The fnSplitStringListXML function will return the delimited values in table format at the following link:

    http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/

    Let us know if helpful.


    Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
    Tuesday, July 20, 2010 12:49 AM
  • thnks sqlusa,

    in our database, the property name column has  something like this Item:B:0:911 and property vales binary has hexadecimal data something like

    0x0001000000FFFFFFFF01000000000000000C02000

    the above hexadecimal data when converted to char gives very unorganized format as shown below:

    ÿÿÿÿOIAMembership, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5236e35bb97009edIAMembership.IAProfileItemm_propm_nameSystem.Collections.Hashtable		testuser5System.Collections.Hashtable
    LoadFactorVersionComparerHashCodeProviderHashSizeKeysValuesSystem.Collections.IComparer$System.Collections.IHashCodeProvider�Q8?¢
    
    		ldapOrgUnitldapCountryHRIS	cn
    ldapSegment
    accountStatussn
    officePhoneslbAliasldapBillableEntity	givenNamepasswordldapRefreshDate	pendingQCldapBizArea+00035631-DXIT000-Photon Infotec ConsultantsIN		Corporate1slb5+1 303 486 (switchboard)AEphremSTHS-Schlumberger Info Solutio	testuser5********
    @lω°�̈ 0!D000-OFS ITSA Contractor

    how to get the columns out of the above data?

     

    Tuesday, July 20, 2010 6:56 PM
  • thnks sqlusa,

    in our database, the property name column has  something like this Item:B:0:911 and property vales binary has hexadecimal data something like

    0x0001000000FFFFFFFF01000000000000000C02000

    the above hexadecimal data when converted to char gives very unorganized format as shown below:

    ÿÿÿÿOIAMembership, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5236e35bb97009edIAMembership.IAProfileItemm_propm_nameSystem.Collections.Hashtable		testuser5System.Collections.Hashtable
    LoadFactorVersionComparerHashCodeProviderHashSizeKeysValuesSystem.Collections.IComparer$System.Collections.IHashCodeProvider�Q8?¢
    
    		ldapOrgUnitldapCountryHRIS	cn
    ldapSegment
    accountStatussn
    officePhoneslbAliasldapBillableEntity	givenNamepasswordldapRefreshDate	pendingQCldapBizArea+00035631-DXIT000-Photon Infotec ConsultantsIN		Corporate1slb5+1 303 486 (switchboard)AEphremSTHS-Schlumberger Info Solutio	testuser5********
    @lω°�̈ 0!D000-OFS ITSA Contractor

    how to get the columns out of the above data?

     

    Tuesday, July 20, 2010 6:56 PM
  • thnks sqlusa,

    in our database, the property name column has  something like this Item:B:0:911 and property vales binary has hexadecimal data something like

    0x0001000000FFFFFFFF01000000000000000C02000

    the above hexadecimal data when converted to char gives very unorganized format as shown below:

     

    hoLoadFactorVersionComparerHashCodeProviderHashSizeKeysValues System.Collections.IComparer$System.Collections.IHashCodeProvider�Q8?¢

       ldapOrgUnitldapCountryHRIS cn
    ldapSegment
    accountStatus sn
    officePhoneslbAliasldapBillableEntity givenNamepasswordldapRefreshDate

    how to even parse ot the columns from the unorganized data above??

     

    Tuesday, July 20, 2010 6:58 PM
  • Just curious if you figured this out or not and what is your SQL Server database version.
    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog
    Tuesday, October 4, 2011 4:11 PM