Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Creating a user profile

Reply
Thread Tools

Creating a user profile

 
 
NickP
Guest
Posts: n/a
 
      12-07-2007
Hi there,

I have authentication setup on a web application that I have created
using the standard asp.net login controls.

I would like to extend the profile of users so that I can store an extra
property for each one. So far I have added the following section to my
web.config file,

<profile enabled="true">
<properties>
<add name="myproperty" type="string"/>
</properties>
</profile>

I have also added the following lines to the my new user registration
page,

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e
As System.EventArgs) Handles CreateUserWizard1.CreatedUser
Dim pPCnProfile As ProfileCommon =
ProfileCommon.Create(CreateUserWizard1.UserName, True)
pPCnProfile.myproperty = "UNSET"
Call pPCnProfile.Save()
End Sub

Unfortunately when the account is created I now recieve the following
error message,

"An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections."

Of course, the rest of the application works, so I can still log in
other users that were created prior to this profile property being
introduced. So any ideas why it can't find the database at that point?

TIA.

Nick.


 
Reply With Quote
 
 
 
 
NickP
Guest
Posts: n/a
 
      12-07-2007
Hi there,

I've managed to fix the problem by configuring the web.config file with
a profile provider,

<profile enabled="true" defaultProvider="myprovidername">
<properties>
<add name="myproperty" type="string"/>
</properties>
<providers>
<clear/>
<add name="myprovidername"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="myconnectionstring"
applicationName="myapplication"
description="SqlProfileProvider for myapplication"/>
</providers>
</profile>

Now the ProfileCommon object can locate the database

Nick.

"NickP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> I have authentication setup on a web application that I have created
> using the standard asp.net login controls.
>
> I would like to extend the profile of users so that I can store an
> extra
> property for each one. So far I have added the following section to my
> web.config file,
>
> <profile enabled="true">
> <properties>
> <add name="myproperty" type="string"/>
> </properties>
> </profile>
>
> I have also added the following lines to the my new user registration
> page,
>
> Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal
> e
> As System.EventArgs) Handles CreateUserWizard1.CreatedUser
> Dim pPCnProfile As ProfileCommon =
> ProfileCommon.Create(CreateUserWizard1.UserName, True)
> pPCnProfile.myproperty = "UNSET"
> Call pPCnProfile.Save()
> End Sub
>
> Unfortunately when the account is created I now recieve the following
> error message,
>
> "An error has occurred while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default settings SQL Server does not allow remote connections."
>
> Of course, the rest of the application works, so I can still log in
> other users that were created prior to this profile property being
> introduced. So any ideas why it can't find the database at that point?
>
> TIA.
>
> Nick.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<profile><properties> with no Profile class Steven ASP .Net 5 10-24-2008 07:23 PM
Visual Studio 2008 asp.net web administration>profile: "The profile wasn't created"? Andy B ASP .Net 0 05-03-2008 05:15 PM
Want to profile monitor for Fuji Frontier ICC profile? Lynn Digital Photography 9 09-08-2005 12:17 PM
Java Web Start app icons keep going in user profile not All Users profile Brad Java 1 07-19-2005 02:10 AM
creating a user profile for the aspnet user Andy Fish ASP .Net Security 2 11-01-2004 05:38 PM



Advertisments