locked
aspnet_profiles question: reading property names from ntext RRS feed

  • Question

  • User1628746328 posted

    I've added a property to the aspnet profiles in the web.config called membership type, and I've been told that this field gets stored automatically in the aspnet_profiles table as a name/value pair.

    I guess what I need to do is have the ability to

    1. Test to see if that value is being stored properly in the table.

    2. Based on that stored value, write logic in the BLL to restrict or allow certain functionality in the site.

    Problem is, I guess the ntext field is a UNICODE data type, and since I've never dealt with UNICODE,  I don't know how to convert that field to human readable text.

     IE: This:

    --------------------------------------------------------------------------------------

    SELECT     CONVERT(VARCHAR(MAX), PropertyNames) AS Expr1
    FROM         aspnet_Profile

    --------------------------------------------------------------------------------------

    Just gives me this:

    FirstName:S:0:6:MembershipType:S:6:1:MemberId:S:7:1:LastName:S:8:5: 

    Thanks in advance for your help

     

    doug

    Monday, August 25, 2008 7:43 AM

Answers

  • User751963951 posted

    You are trying to hard. You should not modify the ASPNET database. It is prebuilt and has all the functionallity that you require.

    All you need in your code is something like this.

    FirstNameTextBox.Text = Profile.FirstName.ToString();

    MemberShipTypeTextBox.Text = Profile.MemberShipType.ToString();

    MemberIdTextBox.Text = Profile.MemberId.ToString();

    I think you get the picture. Let me know how that goes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 26, 2008 9:23 PM

All replies

  • User751963951 posted

    You are trying to hard. You should not modify the ASPNET database. It is prebuilt and has all the functionallity that you require.

    All you need in your code is something like this.

    FirstNameTextBox.Text = Profile.FirstName.ToString();

    MemberShipTypeTextBox.Text = Profile.MemberShipType.ToString();

    MemberIdTextBox.Text = Profile.MemberId.ToString();

    I think you get the picture. Let me know how that goes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 26, 2008 9:23 PM
  • User1628746328 posted

     thanks SpiderMaster.

    Thursday, August 28, 2008 11:30 AM