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.
Member
67 Points
864 Posts
aspnet_profiles question: reading property names from ntext
Aug 25, 2008 07:43 AM|drdexter33|LINK
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
Member
70 Points
102 Posts
Re: aspnet_profiles question: reading property names from ntext
Aug 26, 2008 09:23 PM|SpiderMaster|LINK
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.
Member
67 Points
864 Posts
Re: aspnet_profiles question: reading property names from ntext
Aug 28, 2008 11:30 AM|drdexter33|LINK
thanks SpiderMaster.