can access to role provider but empty string returns RRS feed

  • Question

  • User524370167 posted

    Hi guys,

    I am developing a web site, which has a connection string as follows:

    <add name="NewRemoteSqlServer" connectionString="Data Source=011-27596BAB4D\SQLEXPRESS,1433; Integrated Security=SSPI; AttachDBFilename=C:\ASPNETDB.MDF; User Instance=false " providerName="System.Data.SqlClient"/>

    this connects to a database for membership and role management issues.

    and here are my membership and role manager tags from web.config file:

    				<remove name="AspNetSqlMembershipProvider"/>
    				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="NewRemoteSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
        <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider" domain="">
            <remove name="AspNetSqlRoleProvider"/>
            <add name="AspNetSqlRoleProvider"

    the problem is connection and functionality is quite good for membership, however for role manager, it connects to the database. but when I call the function Roles.GetAllRoles() it returns a string array with length 0(which is supposed to be 5).the strange thing is that it works in a desktop application very well. I think I am missing something. any ideas??

    Friday, July 2, 2010 8:22 AM