Exporting/importing user profile

Discussion in 'ASP .Net' started by Oriane, Apr 9, 2009.

  1. Oriane

    Oriane Guest

    Hi there,

    I have a quite complex UserProfile structure in my Asp.Net site, and I
    wonder whether it is possible to have/write a method like UserProfile.Export
    () which produces a xml serialization stream, and conversely a
    UserProfile.Import ().

    I'm used to export each property one by one in an xml file but it seems more
    straightforward to get directly the content of the field
    PropertyNames/PropertyValuesString in the sql aspnet_Profile table (by
    code), and then to update it...

    Best regards.
    Oriane, Apr 9, 2009
    1. Advertisements

  2. Oriane

    Oriane Guest

    Ïn fact, I think I could use this .Net class:


    which is available by creating a datatable from the aspnetDb database. I
    have to load it with the data from my profile from the database (with a sql
    statement SELECT * FROM aspnet_Profile where UserId = "myUserId" ), and then
    I can save it with the WriteXml method, and then I can update it with the
    ReadXml method. I can have the UserId from the aspnet_Users table (select
    UserId from aspnet_Users where UserName == "MyUserName").

    Sounds pretty simple...don't you think ?
    Oriane, Apr 9, 2009
    1. Advertisements

  3. Hi Oriane,

    I believe this is a simple way to export data from database to xml. Out of
    curiosity, could you tell me why you want to export user profile data to

    Allen Chen
    Microsoft Online Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:

    Get notification to my posts through email? Please refer to

    Note: MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 2 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions. Issues of this
    nature are best handled working with a dedicated Microsoft Support Engineer
    by contacting Microsoft Customer Support Services (CSS) at
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Allen Chen [MSFT], Apr 10, 2009
  4. Oriane

    Oriane Guest

    Hi Allen,

    "Allen Chen [MSFT]" <> a écrit dans le message de
    groupe de discussion : ...
    > Hi Oriane,
    > I believe this is a simple way to export data from database to xml. Out of
    > curiosity, could you tell me why you want to export user profile data to
    > xml?

    In order to archive it AND to re-import it. My client can have a crash on
    his server, the database can be corrupted...
    and I want to avoid to save/archive the database. Now I have an other
    purpose, which is to modify the profile directly into the exported XML,
    before reimporting it.

    Now I can re-create the asp.Net User/account and then make an Update
    statement to import the profile...

    Oriane, Apr 10, 2009
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad
    Roedy Green
    Jul 19, 2005
  2. plb
  3. Andy B
    Andy B
    May 3, 2008
  4. Steven
    Oct 24, 2008
  5. Dagnan
    May 21, 2010

Share This Page