Answered SQL Server 2012

  • Saturday, May 19, 2012 10:01 AM
     
      Has Code

    I have installed SQL Server 2012 Express and am trying to access a database using the following connectionstring:

    <connectionStrings>
    	<add name="TrackerDB" connectionString="server=localhost\SQLEXPRESS;database=DBNAME;Integrated Security=SSPI;persist security info=False;Trusted_Connection=Yes" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    And have added NT AUTHORITY\NETWORK SERVICE to both the server login and database login but yet I am still unable to connect to the database from my ASP.NET C# Intranet Application.

All Replies

  • Saturday, May 19, 2012 10:29 AM
     
     
    Cannot open database \"DBNAME\" requested by the login. The login failed.\r\nLogin failed for user 'MEADOWVIEW\\Tom'."}    System.Exception {System.Data.SqlClient.SqlException}
  • Saturday, May 19, 2012 1:14 PM
    Moderator
     
      Has Code

    IT looks like the application is connecting with "MEADOWVIEW\Tom" rather than the "NT AUTHORITY\NETWORK SERVICE" account you added.  Try adding the "MEADOWVIEW\Tom" login and user:

    USER DBNAME;
    CREATE LOGIN [MEADOWVIEW\Tom] FROM WINDOWS;
    CREATE USER [MEADOWVIEW\Tom];

    Of course, the user will also require SQL permissions on the objects used by the application.

    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/

  • Saturday, May 19, 2012 5:27 PM
     
     

    But shouldn't enabling Windows Auth on the SQL Server allow any domain user into the dbase?

  • Saturday, May 19, 2012 6:03 PM
    Moderator
     
     Answered

    But shouldn't enabling Windows Auth on the SQL Server allow any domain user into the dbase?

    No.  You'll need to create a login for the Windows account (or a Windows group of which the account is a member) in order to authenticate using Windows authentication.  SQL Server is secure out-of-the-box so it wouldn't be a good idea to allow any domain user to connect just because they happen to have a domain account. 


    Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/

  • Wednesday, July 18, 2012 1:09 AM
     
     

    This the same stupidity that sank Vista.  You think Microsoft would learn!

    Particularly with Express Products Access should be enabled.  If it is disabled, then to allow local acess, network access, or web access should be as simple as flipping a switch.  With all the toys at Microsofts Disposal I can not believe that this is not a simple task.


    Bob Jones