Exporting/importing user profile

O

Oriane

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.
 
O

Oriane

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

AspNetDbDataSet.aspnet_ProfileDataTable

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 ?
 
A

Allen Chen [MSFT]

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?

Regards,
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:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

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
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
O

Oriane

Hi Allen,

Allen Chen said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top