Login failed for user 'SQL2005_xxxxxx_AAAAAA_user'

Discussion in 'ASP.NET 2.0' started by stevebramall, May 31, 2007.

  1. Hi

    Please could you help.

    I am attemtping to build an application which does not use default aspnetdb in app_folder but has direct connection to my SQL 205 db histed by DiscountASP. I can connect with no problems using SQL 2005 express management tool and do all usual stuff - add tables ...

    I am using VWD express 2005 to build application. I have followed Scott mitchell's tutorial http://aspnet.4guysfromrolla.com/articles/120705-1.aspxon integrating both login/role/membership information into existing application and am attempting to follow schedule. Actually, only difference is that I am modifing the Role/memebership schema someone else created for me to include my application tables.

    I have used ASP.NET SQL server tool (graphical version) toallow roles and connect to my DASP hosted db and all works fine - test connection is successful.

    I have includedSQLRoleProvider and SQLmemebrshipProvider info as per the tutorial but am getting an error

    There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

    Login failed for user 'SQL2005_XXXXXX_AAAAAA_user'

    I have tested the provider for CustomizedMembershipProvider and CustomizedRoleProvider and gained the error





    Provider Management




    Could not establish a connection to the database.
    If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.


    I have used aspnet_regsql but not at command prompt - not totally sure why this is different to what have done.


    Below is full listing of web.config - no actual pages yet just attempting to assign roles and members





    <!--


    Note: As an alternative to hand editing this file you can use the


    web admin tool to configure settings for your application. Use


    the Website->Asp.Net Configuration option in Visual Studio.


    A full list of settings and comments can be found in


    machine.config.comments usually located in


    \Windows\Microsoft.Net\Framework\v2.x\Config


    -->


    <configuration>


    <appSettings/>


    <connectionStrings>


    <add name="sql2k504.SQL2005_xxxxxx_AAAAAA.dbo" connectionString="Data Source=tcp:sql2k504.discountasp.net;Initial Catalog=SQL2005_xxxxxx_AAAAAA;User ID=SQL2005_xxxxxx_AAAAAA_user;Password=******;" providerName="System.Data.SqlClient"/>


    </connectionStrings>


    <system.web>


    <!--


    Set compilation debug="true" to insert debugging


    symbols into the compiled page. Because this


    affects performance, set this value to true only


    during development.


    Visual Basic options:


    Set strict="true" to disallow all data type conversions


    where data loss can occur.


    Set explicit="true" to force declaration of all variables.


    -->


    <roleManager enabled="true" defaultProvider="CustomizedRoleProvider">


    <providers>


    <add name="CustomizedRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="sql2k504.SQL2005_xxxxxx_AAAAAA.dbo"


    applicationName="kksforum"/>





    </providers>


    </roleManager>


    <membership defaultProvider="CustomizedMembershipProvider">


    <providers>


    <add name="CustomizedMembershipProvider" type="System.Web.Security.SqlMembershipProvider"


    connectionStringName="sql2k504.SQL2005_xxxxxx_AAAAAA.dbo"


    applicationName="kksforum"/>


    </providers>


    </membership>


    <compilation debug="true" strict="false" explicit="true"/>


    <pages>


    <namespaces>


    <clear/>


    <add namespace="System"/>


    <add namespace="System.Collections"/>


    <add namespace="System.Collections.Specialized"/>


    <add namespace="System.Configuration"/>


    <add namespace="System.Text"/>


    <add namespace="System.Text.RegularExpressions"/>


    <add namespace="System.Web"/>


    <add namespace="System.Web.Caching"/>


    <add namespace="System.Web.SessionState"/>


    <add namespace="System.Web.Security"/>


    <add namespace="System.Web.Profile"/>


    <add namespace="System.Web.UI"/>


    <add namespace="System.Web.UI.WebControls"/>


    <add namespace="System.Web.UI.WebControls.WebParts"/>


    <add namespace="System.Web.UI.HtmlControls"/>


    </namespaces>


    </pages>


    <!--


    The <authentication> section enables configuration


    of the security authentication mode used by


    ASP.NET to identify an incoming user.


    -->


    <authentication mode="Forms"/>


    <!--


    The <customErrors> section enables configuration


    of what to do if/when an unhandled error occurs


    during the execution of a request. Specifically,


    it enables developers to configure html error pages


    to be displayed in place of a error stack trace.


    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">


    <error statusCode="403" redirect="NoAccess.htm" />


    <error statusCode="404" redirect="FileNotFound.htm" />


    </customErrors>


    -->


    </system.web>


    </configuration>











    Any ideas????








    many thanks
     
  2. The error has nothing to do with the membership schema.Make sure that you are passing the correct information(sevrer name ,credentials) in your connection string(web.config)
    i.e within <add name='sql2k504.SQL2005_xxxxxx_AAAAAA.dbo' connectionString='Data Source=tcp:sql2k504.discountasp.net;Initial Catalog=SQL2005_xxxxxx_AAAAAA;User ID=SQL2005_xxxxxx_AAAAAA_user;Password=******;' providerName='System.Data.SqlClient'/>

    Also,optionally you can re-set the password for the database user 'SQL2005_xxxxxx_AAAAAA_user' incase you might have modified the password in the past.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Many thanks

    having gone back to discountasp control panel and re-copied the connection string, of course the password shows as ********* rather than actual. I changed the password in my web.config back to actual word and hey presto. I feel a bit stupid!!!

    However, my current password is shown as text. How can I change this to hashing before I upload any actual pages to remote servers.

    Many thanks again
     
  4. Their really is no security risk with your connection string being stored as text as the web and sql server both reside on the same internal network. So no login or passwords are ever distributed out on the internet. However if you still want to encrypt the connections string on your web.config try reading this kb article.

    http://kb.discountasp.net/article.aspx?id=10478
     

Share This Page