Last post Jan 06, 2017 01:39 AM by ma701ss
Jan 05, 2017 12:11 AM|ma701ss|LINK
Hi, I've added the following code to my web.config file:
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="jbConnectionString" applicationName="/" />
<add name="PostCode" allowAnonymous="false"/>
<add name="VisitedOn" type="System.DateTime" allowAnonymous="false"/>
This has allowed me to use the following code in my webpage, and it does not throw an error:
Profile.VisitedOn = DateTime.Now
Profile.PostCode = PostCode.Text
However I cannot find the table where it's storing the values for "VisitiedOn" and "Postcode". Is there a default table?
Jan 05, 2017 03:26 AM|Cathy Zou|LINK
As far as I know. The profile feature provides a generic storage feature that allows you to define and maintain almost any kind of data while still making the data available in a type-safe manner.
To use profile properties, you must configure a profile provider. ASP.NET includes a
SqlProfileProvider class that allows you to store profile data in a SQL database, but you can also create your own profile provider class that stores profile data in a custom format and to
a custom storage mechanism such as an XML file, or even to a web service.
Besides, because data that is placed in profile properties is not stored in application memory, it is preserved through Internet Information Services (IIS) restarts and worker-process restarts without losing data. Additionally, profile properties can be
persisted across multiple processes such as in a Web farm or a Web garden
Jan 06, 2017 01:39 AM|ma701ss|LINK
Thanks, I've already created a profile provider. I've found the table the profile data is stored in, it's dbo.aspnet_Profile.