0

I am using Membership in .net web application. I have the following web.config configuration...

  <profile ...>

      .....

          <properties>
               <add name="FirstName"/>
               <add name="LastName"/>
               <add name="DateOfBirth" type="DateTime"/>
               .....
          </properties>
  </profile>

I inserted data using the following code segment, which affected the aspnet_profile database table.

    dynamic profile = ProfileBase.Create("Username");
    profile.Initialize("Username", true);
    profile.FirstName = "someFirstName";
    profile.LastName = "someLastName";
    profile.Save();

Now please anyone suggest me how to retrieve this data.

Emon Emoni
  • 133
  • 1
  • 5
  • 17

2 Answers2

1

Now please anyone suggest me how to retrieve this data.

You can use System.Web.Profile.ProfileManager and then its API like FindProfilesByUserName(), GetAllProfiles() etc.

Here is already a solved thread.

Community
  • 1
  • 1
ramiramilu
  • 17,044
  • 6
  • 49
  • 66
  • If my post helps, can you please mark it as answer, that would help others to find out solutions pretty quick. – ramiramilu Jan 28 '14 at 12:00
0

This is what i did to retrieve profile property value...

string Firstname = ProfileBase.Create("UserName").GetPropertyValue("FirstName").toString();
Emon Emoni
  • 133
  • 1
  • 5
  • 17