Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
I am getting this exception when trying to get or create a user using Membership or Profile.Here is my web.config code.I am using VS2010 Framework 4.0.

What could be the problem?
C#
    <connectionStrings>
    <add name="classConnectionString" connectionString="Data Source=MINHAS\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"/>
</connectionStrings>
    <profile defaultProvider="MyProvider">
        <properties>
            <add name="Name" type="System.String"/>
            <add name="ID" type="System.String"/>
            <add name="Color" type="System.String"/>
        </properties>
        <providers>
            <clear/>
            <add name="MyProvider" type="System.Web.Profile.SqlProfileProvider" connnectionStringName="classConnectionString" applicationName="/"/>
        </providers>
    </profile>
    <membership defaultProvider="MyProvider">
        <providers>
            <add name="MyProvider" connnectionStringName="classConnectionString" type="System.Web.Security.SqlMembershipProvider" applicationName="/" enablePasswordRetrieval="true" enablePasswordReset="true" passwordFormat="Encrypted" requiresQuestionAndAnswer="true"/>
        </providers>
    </membership>
Posted

You have given three times n in connection string name
C#
incorrect 
connnectionStringName="classConnectionString"


correct

C#
connectionStringName="classConnectionString"
 
Share this answer
 
Comments
madhuri@mumbai 15-Jan-13 0:28am    
Good observation..
MairajAhmed 16-Jan-13 11:51am    
Thanks a lot.It helped.
 
Share this answer
 
Comments
MairajAhmed 13-Jan-13 4:30am    
I have already seen that but this does not help because i have already set connectionStringName in provider section

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