Click here to Skip to main content
16,016,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I have a problem.I wanna create a profile in a website.But I couldn't.


I added some codes in webconfig.

XML
<system.web>


<profile>
  <providers>
    <clear/>
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfilProvider"/>

  </providers>
  <properties>
    <add name="Name"/>
    <add name="Surname"/>
  </properties>
</profile>


goes on.

But I could not access "Profile" in code part.Help me please
Posted

1 solution

I guess your setting is missing something (ConnectionStringName property) (Assuming that you have prepared all other things correctly including preparing the database for Membership and profile):

XML
<profile>
  <providers>
    <add name="AspNetSqlProfileProvider"
         connectionStringName="Conn"
         applicationName="/"
         type="System.Web.Profile.SqlProfileProvider />
  </providers>
</profile>


And, you should have a ConnectionStrings setting in the web.config, which should have a matching Name:

XML
<configuration>
<connectionStrings>
  <remove name="Conn"/>
  <add name="Conn"
       connectionString="server=db;database=aspnet;integrated security=sspi;"
 />
 </connectionStrings>
 ...
</configuration>


This Link[^] has some detailed discussion about configuring Profile in Asp.net.
 
Share this answer
 
Comments
Dalek Dave 31-Aug-10 11:41am    
Good Answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900