locked
cannot connect to database RRS feed

  • Question

  • User1090056415 posted


    I have deployed asp web app in dedicated server but whenever i try to connect to database it thows this error

    Cannot open database "Raghav_onlinestock" requested by the login. The login failed.

    Login failed for user 'SERVER\IWPD_4260(ssgrpkol)'.


    this is my connection string:  

    <connectionStrings>
    <add name="con" connectionString="Data Source=108.163.224.173;Initial Catalog=Raghav_onlinestock;Integrated Security=True;Pooling=False"/>
    </connectionStrings>

    and this my webconfig file

    <?xml version="1.0"?><!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    -->
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>

    <connectionStrings>
    <add name="con" connectionString="Data Source=.\sqlexpress;Initial Catalog=Raghav_onlinestock;Integrated Security=True;Pooling=False"/>
    </connectionStrings>
    <system.web>
    <!--<compilation debug ="true "></compilation>-->
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
    <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies><buildProviders><add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></buildProviders></compilation>
    <authentication mode="Forms">
    <forms loginUrl ="~/Account/Login.aspx" timeout="2880"/>
    </authentication>
    <membership>
    <providers>
    <clear/>
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
    </providers>
    </membership>
    <!--<urlMappings enabled ="true">
    <add url ="~/User_Account.aspx?u=1" mappedUrl ="~/Handler.ashx"/>

    </urlMappings>-->

    <profile>
    <providers>
    <clear/>
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
    </providers>
    </profile>
    <roleManager enabled="false">
    <providers>
    <clear/>
    <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
    <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
    </providers>
    </roleManager>
    </system.web>
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
    </configuration>


    Sunday, June 30, 2013 3:36 AM

Answers

  • User1508394307 posted

    Login failed for user 'SERVER\IWPD_4260(ssgrpkol)'.

    This error occurs when you use "Integrated Security=True;" but SQL Server was not configured for the login with IIS user credentials. If want to use Integrated Security, you need to configure login (see example). Otherwise, use user name and password to connect

    Data Source=108.163.224.173;Initial Catalog=Raghav_onlinestock;User Id=USER;Password=PASSWORD;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 30, 2013 3:44 AM

All replies

  • User1508394307 posted

    Login failed for user 'SERVER\IWPD_4260(ssgrpkol)'.

    This error occurs when you use "Integrated Security=True;" but SQL Server was not configured for the login with IIS user credentials. If want to use Integrated Security, you need to configure login (see example). Otherwise, use user name and password to connect

    Data Source=108.163.224.173;Initial Catalog=Raghav_onlinestock;User Id=USER;Password=PASSWORD;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 30, 2013 3:44 AM
  • User1815411410 posted

    Hi manishse,

    If you have deployed your site to a shared server, you certainly cannot use the connection string

    <add name="con" connectionString="Data Source=108.163.224.173;Initial Catalog=Raghav_onlinestock;Integrated Security=True;Pooling=False"/> 

    This is simply because of the fact that when you are on a shared server, you need to create another unique sql database for your db. Hence, you need to alter your connection string so that it look something like:

    <add name="con" connectionString="Data Source=our_SQL_SERVER_ID;uid=your_DB_username;pwd=your_DB_password;Initial Catalog=your_DB_name"></add>

    Please mark this response as an "answer" if it helps you. Thanks heaps!

    Monday, July 1, 2013 3:58 AM
  • User-1998339254 posted

    Hi,

    You could try this one

    <add name="con" connectionString="Data Source=.\SQLExpress;User ID=sa;Password=*******;Initial Catalog=DATABASE NAME"></add>


    Thanks and regards

    Liju

    Monday, July 1, 2013 4:12 AM