473,565 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Profile. Need advice ...

Hello,

I have a profile with multiple profile properties in my Web.Config:

<add allowAnonymous= "false" name="Contact" type="Contact"
serializeAs="Bi nary"/>
<add allowAnonymous= "false" name="Options" type="Options"
serializeAs="Bi nary"/>

Where each profile property is class, as follows:

<Serializable() _
Public Class Contact
Inherits ProfileBase

' City
Public Property City() As String
Get
Return CType(Me("City" ), String)
End Get
Set(ByVal value As String)
Me("City") = value
End Set
End Property ' City
...

End Class

I am creating a new profile to a user which I just created as follows:

Dim myContact As Contact = CType(ProfileBa se.Create(usern ame), Contact)
With myContact
.City = tbCity.Text
...
End With
contact.Save()

My question is:

Do I need to repeat this code to all my profile properties or is there
a better way to do this?

I have been Goggling for information on how to create a new profile for
a user which have been just created where there are various properties
and all them are custom classes.

Any advice would be great.

Thanks,

Miguel

Jan 16 '07 #1
1 1344
If you are making individual classes that store in profile, you will have to
work each one separately and add to profile. You can get around repeating
this in multiple locations, by setting up a class that holds the
save/retrieve profile information, but you will still have to have the code
for each class you are serializing into the profile.

Hope I answered the question you were asking. :-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** **************
Think outside the box!
*************** *************** **************
"shapper" <md*****@gmail. comwrote in message
news:11******** **************@ 38g2000cwa.goog legroups.com...
Hello,

I have a profile with multiple profile properties in my Web.Config:

<add allowAnonymous= "false" name="Contact" type="Contact"
serializeAs="Bi nary"/>
<add allowAnonymous= "false" name="Options" type="Options"
serializeAs="Bi nary"/>

Where each profile property is class, as follows:

<Serializable() _
Public Class Contact
Inherits ProfileBase

' City
Public Property City() As String
Get
Return CType(Me("City" ), String)
End Get
Set(ByVal value As String)
Me("City") = value
End Set
End Property ' City
...

End Class

I am creating a new profile to a user which I just created as follows:

Dim myContact As Contact = CType(ProfileBa se.Create(usern ame), Contact)
With myContact
.City = tbCity.Text
...
End With
contact.Save()

My question is:

Do I need to repeat this code to all my profile properties or is there
a better way to do this?

I have been Goggling for information on how to create a new profile for
a user which have been just created where there are various properties
and all them are custom classes.

Any advice would be great.

Thanks,

Miguel
Jan 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2212
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base class would have CurrentUser property that would hold customer class in session and that was fine for all my situations. Now ASP.NET 2.0 came...
4
1351
by: va | last post by:
I realize that ASP.NET profile provider is used to create a strongly typed storage of data that can be used like Session variables but can survive beyond sessions. In my ASP.NET 2.0 application, I am thinking of using the ASP.NET profile provider and its the binary storage capability to store a lot of my user's custom variables versus...
0
1061
by: Brent Borovan | last post by:
Hello, We have an ASP.NET application which uses the new Profile feature of ASP.NET 2.0 to maintain user profile information. As part of the software system we are developing, we need to access the profile information from a separate Windows application and/or service. The Profile is a part of the System.Web name space and we are not...
34
29836
by: Tom | last post by:
I'd greatly appreciate advice and code snippets on how to create a ram disk within a C/C++ program. I also need to be able to determine the free space. Thanks in advance for any help.
2
1650
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm developing a web portal where users must login to. As far as I know all users are accessible from the MembershipUserCollection. I know that current user is also accessible via the Profile object in the webpage, but I want to access the properties of one of the other users. So I guess I have to create an instance of...
2
1667
by: Darius | last post by:
Hello I implemented custom profile provider based on the example at http://msdn2.microsoft.com/en-us/library/ta63b872.aspx. It reads Profiles values from tables in Sql Server. Everytime when I read Profile property (e.g. string Name = Profile.FirstName) GetPropertyValues function is called. However after this function SetPropertyValues...
0
1005
by: shapper | last post by:
Hello, On the web site I am working I have multiple profile properties, being each one a custom class: <add allowAnonymous="false" name="Personal" type="MyWebSite.Profile.Collaborator" serializeAs="Binary"/> <add allowAnonymous="false" name="Contacts" type="MyWebSite.Profile.Contact" serializeAs="Binary"/> <add allowAnonymous="true"...
2
2289
by: Nick | last post by:
Hi there, I have a web site, with a web service in folder within the website. Everything works as I would expect it to. I have just added some functionality to the web service that accesses a user profile and then updates one of the settings then saves the profile. No exceptions occur during this process and as far as I can see it all...
1
2659
by: shapper | last post by:
Hello, On my CMS I am signed as administrator and I am creating a Membership user and its profile: MembershipCreateStatus status; MembershipUser user = Membership.CreateUser("Joe", "Pass", "Joe@email.com", null, null, true, null, out status); if (user != null) { ProfileHelper profile =
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.