Uisng asp.net 2.0 profile

Posted: October 3, 2005 in Uncategorized

 

Configure the web.config to point to the DBProfile Database and add 2 properties to the profile

 

<

configurationxmlns=http://schemas.microsoft.com/.NetConfiguration/v2.0><

connectionStrings>

<

addname=myConnectionStringconnectionString=Server=sreeman;Trusted_Connection=true;database=DBProfile

providerName=System.Data.SqlClient />

</

connectionStrings>

<appSettings/>

<

system.web>

<

profiledefaultProvider=MyProfileProvider>

<

providers>

<

addname=MyProfileProvidertype=System.Web.Profile.SqlProfileProviderconnectionStringName=myConnectionString/>

</

providers>

<

properties><addname=FirstNametype=System.StringdefaultValue=Shreeman/><addname=LastNametype=System.StringdefaultValue=dash/></properties>

</

profile>

<

compilationdebug=true/>

</

system.web>

</

configuration>

 

if

(!IsPostBack)

{

Profile.FirstName = “Ash”;

Profile.LastName =

“rai”;

}

TextBox1.Text = Profile.FirstName;

TextBox2.Text = Profile.LastName;

string strusername = Profile.UserName;

ProfileManager.DeleteProfile(strusername);

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s