how to add the following to membership table in aspnetdb.mdf

I have the following:

<profile defaultProvider="OL_ProfileProvider">
        <add name="OL_ProfileProvider" connectionStringName="LocalSqlServer" type="System.Web.Profile.SqlProfileProvider"/>
        <add name="Email"/>
        <add name="UserName"/>
        <add name="Password"/>
        <add name="FullName"/>
        <add name="Gender"/>
        <add name="DOB" type="System.DateTime"/>
        <add name="City"/>
        <add name="Region"/>
        <add name="Country"/>
how do are these created. I think they are binaries that I cannot see.

Who is Participating?
techExtremeConnect With a Mentor Commented:
Yes I don't see any problem in it.
Assuming your Profile.DOB holds valid datetime value as  a string, you can do Convert.ToDatetim Profile.DOB) and you'll get the datetime.
Is there any problem with the code you posted? have you tried convert.todatetime as I suggested?
let me know of any issues.

Enjoy Coding!
I see you have created few profile properties. Actually you cannot see them directly just by looking at profile table in say the SQL diagram or so. So in a way they are hidden. Actually the names are stored in the rows internally. You do not need to create the required fields in database, they get created automatically once you define them in web.config.

When you enable Personalization in your ASP.NET 2.0 website you can set up a collection of properties that will be maintained for each user of your website (even for the anonymous visitors), which  is exactly what you did.

 Personalization Profiles are often used to store personal data of website users, their personal preferences, visual themes, language settings etc.
 Here is a sample Profile setup in web.config:
    <anonymousIdentification enabled="true" />
        <add name="UserCulture" defaultValue="en-US"></add>

So we have added property to be stored for each user (to keep their language preferences) and here is how we can access them in our code:
      this.Culture = this.Profile.UserCulture;
This is because the profile class is generated dynamically (on the fly) using the properties you define in web.config.  You just simply have to use them in your code as required to fetch user specific information.

Hope this helped.

Enjoy Coding!
mathieu_cuprykAuthor Commented:
if i have a datetimepicker of type string.
I cannot convert it. before it goes into the table.
So should i just leave this type string.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hia, yet it will work if you leave it as type string but remember that you will get it as a string too.
I myself follow a common rule regarding date if it is to be stored in string format which is tht always pass it in format dd-MON-yyyy and retrieve accordingly, that way you need not to worry about the backend, for example how the sql server requires date to be in specific format or not etc..
Anyways hope i solved the doubt, let me know of any issues.
Enjoy Coding!
mathieu_cuprykAuthor Commented:
here now I need to pass a datetime
Profile.DOB needs to be of datetime.
   lblZodiacSign.Text = ZodiacSign(Profile.DOB);
    lblAge.Text = getAge(Profile.DOB);
mathieu_cuprykAuthor Commented:
very well answered question. detailed, and write to the point.
Thanks. Enjoy Coding!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.