Integrated Security And Login Failed For User 'NT AUTHORITYNETWORK SERVICE'
Jun 17, 2006
I got a website using .Net v2.0.xxx and SQL Server Express 2005 in a Win2003 Domain Controller machine. Both website and SQLServer is running on the same machine. Website and SQLServer are configured to accept only Integrated Windows Authentication. Domain Users group is added in SQLServer logins list and given Read and Write access to the database used by the website. Also Domain Admins groups is added and given full permission to the same database.
I thought since website will run only with login details from Active Directory, SQL Server connection is also going to be validated against the same login details. But I felt I got the whole concept wrong when I received the error mentioned in subject line.
Can anyone please explain the best way to connect to database in above-mentioned context. Please remember that I need to implement different rights on the database for 'Domain Users' and 'Domain Admins' group. If there is a better approach than using these groups, lemme know please.
I have built a web page in visual web developer express and I moved it over to use IIS. I gave NT AUTHORITYNETWORK SERVICE read and write permissions to the folder and included it in my IIS virtual folder. I can see the login page just fine. I can create a user just fine. I can even access the forgot password page just fine. But if I try to login in I get this stack trace. I can't figure out what more I need to do for NT AUTHORITYNETWORK SERVICE. Can any one help.Server Error in '/' Application. Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException (0x80131904): Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITYNETWORK SERVICE'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
have built a web page in visual web developer express and I moved it over to use IIS. I gave NT AUTHORITYNETWORK SERVICE read and write permissions to the folder and included it in my IIS virtual folder. I can see the login page just fine. I can create a user just fine. I can even access the forgot password page just fine. But if I try to login in I get this stack trace. I can't figure out what more I need to do for NT AUTHORITYNETWORK SERVICE. Can any one help. Server Error in '/' Application. Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException (0x80131904): Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITYNETWORK SERVICE'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Mr :I have proplem with Visual stdio 2003 and Windows2003Enterprise Server , when I developed web applicationusing ASP.Net (VB) that establish connection to SQL Serverdatabase the following error appeared.Server Error in '/WebApplication1' Application.Login failed for user 'NT AUTHORITYNETWORK SERVICE'
Hi! I developed one web application, in that i created some users and roles. When its running from my system, users are getting logged. But the problem is - when I hosted this site on my domain server its giving error like - " System.Data.SqlClient.SqlException: Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITYNETWORK SERVICE' ". Its giving this error when i am trying to login. Is there any thing i am missing with Sqlserver. Please help me! thanks in advance!
I cant seem to deploy a DB to my server. Can anyone actually help with this? I have been goint through lots of different things to get it to work... So far I have added the network service account to SQL Express 2005 through the express managment console I have also given NETWORK SERVICE explicit permissions on the database files themselves. It works great on my dev box. I'm able to login and access my secondary DB but when i try to push the site to my server this is what happens. Any help on this is great -- if you need me to post any more of my code -- no problem This is my exact error: SqlException (0x80131904): Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.] My web.config file looks like: <!-- 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 WindowsMicrosoft.NetFrameworkv2.xConfig --> <configuration> <appSettings/> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|igx-ma.mdf;Integrated Security=True;User Instance=True" 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. --> <identity impersonate="true"/> <authentication mode="Forms" /> <authorization> <deny users="?" /> <allow users="*" /> </authorization>
<roleManager enabled="true" />
<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. --> <!-- 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.
OK I know that this topic seems like it has been beaten to death in the forums but I'm still unable to figure out why I'm getting this error. I've added the NT AuthorityNetwork Service to the SQL server and the database that I want to connect to. I've made it the db_owner. Still got the error. I added myself (the account I login with into windows) with the same options as with the NT Authority. Still got error. I'm runnin SQL Server 2005 on my local machine as well as IIS 6. I know that my web.config is correct because I only started getting this error after I reinstalled SQL Server and IIS. I've really run out of ideas of why this is happening. I'm assuming from the error message that it's at the database level but I just don't know where. Here are exerts from my web.config that may help:<connectionStrings> <remove name="database"/><add name="database" connectionString="Data Source=(local);Initial Catalog=TheBugZoo;Integrated Security=True;" providerName="System.Data.SqlClient"/> </connectionStrings><roleManager enabled="true" cacheRolesInCookie="true" cookieName="TBZROLES" defaultProvider="TBZ_RoleProvider"> <providers><add connectionStringName="database" applicationName="/" name="TBZ_RoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </providers> </roleManager>
Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITYNETWORK SERVICE'.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
thats my error and my connection is <connectionStrings> <add name="hayatConnectionString" connectionString="Data Source=laptop;Integrated Security=SSPI;Pooling=False;Initial Catalog=hayat" providerName="System.Data.SqlClient"/></connectionStrings> i test the Integrated Security= with true false and sspi and i can't access to database my windows vista and iis7
i face the a problem, Login failed for user 'NT AUTHORITYNETWORK SERVICE'. i already add login permission in SQL management for 'NT AUTHORITYNETWORK SERVICE'. it's not working. The default database shows 'master' as default database. do i need to change to aspnetdb.mdf database?.
Hi All. I'm new to SQL 2005 server so please bare with me. I just recently setup SQL 2005 on a server in my network and created my first database table. As a test I then create a default.aspx page to access my database/table and load some information into a datagrid. When I push the page up to my server and try to view it in a browser I'm getting the following error: Login Failed for user 'NT AUTHORITYNETWORK SERVICE'A server error occured on the current command. Based on the error I assumed it was a permissions issue. So I went back to the server and openned up 'SQL Server Management Studio', opened up the 'database' folder and right-click my database and choose 'Properties' Under 'Properties' I selected the 'Permissions' and then the 'View Server Permissions' link. From the list I select 'NT AUTHORITYNETWORK SERVICE' user. Once selected I see a list of permissions, such as: - Administer bulk operations- Alter any connection- Alter any credential- Alter any database Does anyone know what permission I need to select in order to allow my aspx page to work?
Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
I've just installed Windows Server 2003 and can't get past this. I've changed the <processModel> userName to SYSTEM, I've added ASPNET to the Admin group, other tweaks with reboot but still can get it to work. I'm not sure what the NT AUTHORITY domain is.
QuickStart samples and applications coming with .NET Framework SDK include "A Personalized Portal", "An E-Commerce Storefront", etc. are working properly with no problem.
I downloaded and installed IBuySpy Store and Portal from www.asp.net. While running default.aspx of these samples the following error occurs:
Server Error in '/StoreCS' Application. --------------------------------------------------------------------------------
Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
I use Window server 2003 and Sql server 2000. both run on the same machine. The machine is behind a router. Port 1433 is forwarded.
------------------------loginfailed.aspx go as follows--------------------- <%@ Page Language="vb" runat="server" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.SqlClient" %>
<script runat="server"> Sub Page_Load() Dim myConnection As New SqlConnection() myConnection.ConnectionString = "server=localhost; database=pubs;_ Persist Security info=False; Integrated Security=SSPI; Connect Timeout=30" myConnection.Open() End Sub </script> ------------------------------------------------------------------------------
That program generates error message: Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
However, OleDB works fine. relly dont know what has gone wrong.
I've tried to use Windows authentication to connect to database in MS SQL Server 2000, my connection string like below: "server=(local);Initial Catalog=myDatabase;Trusted_Connection=yes" when I run my code, there is an error occur with below message: Login failed for user 'NT AUTHORITYNETWORK SERVICE' My SQL Server is configured as Window authentication. I can't resolve this problem. Please whow me how to do! Thank you very much!
Any help would be very very much appreciated as I am about 15 hours into this :(
Background is a development system with ASP.NET 2.0 and SQL express 2005. The server is SQL 2005 standard edition. Any ASPX pages that connect to a database results in errors.
I have 2 identical servers with Windows server 2003, one has SQL Express and the other has SQL Server 2005 standard. that is the only difference between these systems. The scripts that work seamlessly when uploaded to the SQL Express server dont work on the SQL Server 2005
1.) No matter what the initial catalog is pointing to, I get the same error. EVEN if the database doesnt exist
Cannot open database "C:INETPUBWWWROOT estapp_dataaspnwet.MDF" requested by the login. The login failed. Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
2.) second interesting thing is this, if I change the datasource to "MSSQLSERVER" which is the instance name of SQL 2005. the error changes to
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I have reinstalled SQL server 2005
I have verified that under SQL Server 2005 Surface Area Configuration that remote connections has Both TCP and Named Pipes enabled
I have verified that under the Network Configuration that the protocols for TCP/IP and Named pipes are enabled.
I have tried atleast 20 different variations of Connectionstrings
I have ran aspnet_regsql against the database
I have verified that the SQL Server Browser is started
I have verified that the TCP/IP is set in Network Configuration to default port 1433
I have gave all authentication rights to Network Service and ASPNET accounts for testing against both the MASTER and ASPNET databases using Management Studio and attaching the Database
I have created a custom SQL account with access to the database in question and added the username password syntax to the connectionstring and get the same login failed message.
If anyone can give any insight that would be MUCH appreciated!! thanks in advance.
(1) SQL 2005 on a member server, Windows Authentication
(2) I'm using Visual Studio.Net 2005 on my Windows XP sp2 work station.
(3) From my machine, within my development application, I have no problem accessing the Data in the SQL server.
(4) I Receive the Login Failed error after I copy my project to the Test Web Server (Same machine that houses SQL) and test from either my machine or from the host server.
More details of the error message are:
Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITYNETWORK SERVICE'.
Source Error:
Line 33: DA = New SqlDataAdapter(sSql, CONN_STRING) Line 34: DS = New DataSet Line 35: DA.Fill(DS) Line 36: Line 37: Session("NameInquiry_DS") = DS
The finished product is to be an Intranet site only; accessible by employees within our own private network.
The SQL is a new install with only test data.
What have I missed that is causing the permission problem? The event viewer shows a nonauthenticated user is causing the problem. But, how do I correct this?
Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. I have This Error When i try to log into My online web site, i have no idea how to fix it,one day it was working and the next it wasnt, is there any way to find out what database the default is and if it's either incorrect or not present change the web.config in a way that will make my system work. i have the NT Authority/Network Service in my Server Properties Permissions, its given the type login and is granted Connect SQL by sa i have 3 colder copies of the web site on my server my question is, how would i use of of these to restore the original site configuration is there a way to restore the original configuration to undo whatever it is i've done to break the system ChrisStressed
I am trying to connect SQL database through code but I get this error,I have spent days to solve it but unfortunately I couldn't...Here is my code in VB express(OP:windows 2000 with SP4)I am new to VB,so it makes the situation more difficult for me.
my code is:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn1 As SqlConnection = _
New SqlConnection("Data Source=.SQLEXPRESS;" & _
"Integrated Security=SSPI;" & _
"database=deneme3_database;")
'Open connection
conn1.Open()
MessageBox.Show("Connection succeeded.")
'Close connection
conn1.Close()
MessageBox.Show("Connection closed.")
End Sub
The error message is,it is in german but it is clear I guess:)
" Die von der Anmeldung angeforderte "deneme3_database"-Datenbank kann nicht geöffnet werden. Fehler bei der Anmeldung. Fehler bei der Anmeldung für den Benutzer 'ADPLANatalay'. "
I have a domaincontroller running win 2003 server. A webserver running win 2003 server and SQL 2000 server. Im working on a win XP client whit Visual Studio.Net witch i use to make my aplication.
On the XP client i have a copy of MSDE running. When i run the aplication on that machine it works fine. But when i try to get the aplication running on my webserver with SQL 2000 i get the error message.
How can i see with what user my aplication is trying to acces my SQL server? I think i should look there for the solition.
I'm installing Windows Small Business Server 2003 R2 Premium. I am at the stage where I am installing the Premium Technologies. Specifically, I am trying to configure permissions for the new SHAREPOINT instance of SQL Server 2005. When I try to create the new login NT AuthorityNetwork Service, typing it exactly as specified in the instructions, I get the following error:
Create failed for Login 'NT AUTHORITYNetwork Service' (Microsoft.Sqlserver.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Windows NT user or group 'NT AUTHORITYNetwork Service' not found. Check the name again. (Microsoft SQL Server, Error: 15401)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=15401&LinkId=20476
I am trying to add Login user 'NT AUTHORITYNetwork Service' to role 'aspnet_Membership_FullAccess' using the following statements. I have attached database ASPNET.mdf to SSMS. -- Create a SQL Server login for the Network Service accountsp_grantlogin 'NT AUTHORITYNetwork Service'-- Grant the login access to the membership databaseUSE aspnetdbGOsp_grantdbaccess 'NT AUTHORITYNetwork Service', 'Network Service'-- Add user to database roleUSE aspnetdbGOsp_addrolemember 'aspnet_Membership_FullAccess', 'Network Service' I am getting the following error message Msg 911, Level 16, State 1, Line 5 Could not locate entry in sysdatabases for database 'ASPNETDB'. No entry found with that name. Make sure that the name is entered correctly. Msg 911, Level 16, State 1, Line 4 Could not locate entry in sysdatabases for database 'ASPNETDB'. No entry found with that name. Make sure that the name is entered correctly. Msg 15014, Level 16, State 1, Procedure sp_addrolemember, Line 36 The role 'aspnet_Membership_FullAccess' does not exist in the current database.
On displaying the contents of view sys.databases, I am able to see row for ASPNET. Please let me know what the problem is and how I could fix it. Thanks, Anita
Any idea why I cannot connect to a SQL Server database using SqlConnection and no Integrated security? I get a "Login failed for user 'XXXX'" error. The user ID and password I am using are all correct and have the required access (tested several times from different places).The connection string I am using is: "Server=XXXXX;Database=XXXXX;Trusted_Connection=fal se;User ID=XXXX;Password=XXXXX" I have also tried replacing "Server" by "Data source", "Database" by "Initial catalog", "Trusted_Connection" by "Integrated security", "User ID" by "UID" and "Password" by "PWD".Any ideas?
I have been struggling with this problem for a while with SQL 2005. I have never had such login problem with SQL 2000. Here is the scenario:
I have installed SQL2005 standard version on a XP Pro box and I am trying to access it from another XP Pro machine. I can access it using a SQL user name and password that I set up on the server, but I have not had luck with using Windows NT Integrated security. When I try to connect to it (e.g. by a UDL file), I get an error saying Login failed for user €˜HP-AMD64Guest€™ where €˜HP-AMD64€™ is the name of the PC running the SQL 2005. I can access the files on the machine without any problem. I do not understand why it uses €˜Guest€™ that is not what I use to log on my machine. Does anyone have any clue to offer me?
We have a Web application that requires user authentication. We have a Login Page for user's to login and be authenticated. We also manage the user accounts using SQL Server Membership Provider. We created aLogin user in SQL Server and used this user's privileges to connect to SQL Server in our website's connection strings. Example, in our Web.config file, the connection string is:
<connectionStrings> Â <addname="MyConnectionString"connectionString="Server=MYSERVERNAMESQLSERVER2012;Initial Catalog=MyDatabase;User Id=TUser;Password=MyPassword"providerName="System.Data.SqlClient"/> </connectionStrings>
The problem now is when a user logs in, it's throwing an error that TUser's password has already expired. We did not enforce the password policy and expiration date for this user. So, I'm wondering why it's giving me this error.
i'm using the Enterpirse library logger to write logs into a database. When choosing connection string i choose the database i want in the "connection properties" dialog box and push 'Test connection' button. everything goes well.
then i open the SQL Server Management studio express and connect to the databse to check some things, from that point on , when i push the 'Test Connection' button in the Enterprise library i get the error:
"cannot open user default database. Login failed. login failed for user My'server/MyuserName'"
even when i close the sql server manager , it is still stuck - the connection test doesn't work anymore.... it only work when i restart the computer.
I just installed the Issue Tracker using .net 1.1 (on my computer). When I try to log in via the login page, I get:
Login failed for user 'NT AUTHORITYLOCAL SERVICE' Here is my stack trace info: SqlException: Login failed for user 'NT AUTHORITYLOCAL SERVICE'.] System.Data.SqlClient.ConnectionPool.CreateConnection() +402 System.Data.SqlClient.ConnectionPool.UserCreateRequest() +151 System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +386 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 ASPNET.StarterKit.IssueTracker.DataAccessLayer.SQLDataAccessLayer.ExecuteScalarCmd(SqlCommand sqlCmd) +129 ASPNET.StarterKit.IssueTracker.DataAccessLayer.SQLDataAccessLayer.Authenticate(String username, String password) +184 ASPNET.StarterKit.IssueTracker.BusinessLogicLayer.ITUser.Authenticate(String username, String password) +44 ASPNET.StarterKit.IssueTracker.DesktopDefault.Login(Object s, EventArgs e) +84 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292
I have added everyone, asp.net, local service, network service - all full control on the entire folder. Restarted IIS - still can't log in. Please help.
i need some advise with this error.i created a new web project form, added a dataadapter, connection and dataset to a webform. When creating the connection, no errors. Used the query builder to select the necessary tables, also no errors. i competed and built the project, loaded it in a web browser and bang, login failed for user NT AUTHORITYNETWORK SERVICE. it happens at both the workstation and server.system.data.sqlexception: login failed for user 'nt authorityetwork service'.my dev box is an xp pro workstation. the project is stored on a 2003 web server (unc share). i'm working on an intranet project using visual studio 2003 to display data from sql server db. i've set and reversed a number of security settings in sql and iis trying to correct this error, i'm just not getting it. also, prob not closing the connection when this error occurs either; using SqlDataAdapter1, SqlConnection1 and DataSet11any suggestions are greatly appreciated.(webform1.aspx.vb)Imports System.DataImports System.Data.SqlClient Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection Me.DataSet11 = New WebApplication_01.DataSet1 CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit() ' 'SqlDataAdapter1 ' Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1 Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "ORDERS", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("Record#", "Record#"), New System.Data.Common.DataColumnMapping("Order#", "Order#"), New System.Data.Common.DataColumnMapping("DateOpened", "DateOpened"), New System.Data.Common.DataColumnMapping("DriverName", "DriverName"), New System.Data.Common.DataColumnMapping("Reference", "Reference"), New System.Data.Common.DataColumnMapping("CustomerName", "CustomerName"), New System.Data.Common.DataColumnMapping("StreetAddress", "StreetAddress"), New System.Data.Common.DataColumnMapping("City", "City"), New System.Data.Common.DataColumnMapping("State", "State"), New System.Data.Common.DataColumnMapping("Zip", "Zip"), New System.Data.Common.DataColumnMapping("OrderStatus", "OrderStatus"), New System.Data.Common.DataColumnMapping("OrderNotes", "OrderNotes"), New System.Data.Common.DataColumnMapping("OrderDueBy", "OrderDueBy"), New System.Data.Common.DataColumnMapping("ServiceName", "ServiceName"), New System.Data.Common.DataColumnMapping("LastModified", "LastModified")})}) ' 'SqlSelectCommand1 ' Me.SqlSelectCommand1.CommandText = "SELECT ORDERS.RECID AS Record#, ORDERS.ORDERNUM AS Order#, ORDERS.ORDERDATE AS Da" & _ "teOpened, Users.Name AS DriverName, ORDERS.REFERENCE AS Reference, ORDERS.CLIENT" & _ " AS CustomerName, ORDERS.ADDRESS AS StreetAddress, ORDERS.CITY AS City, ORDERS.S" & _ "TATE AS State, ORDERS.ZIPCODE AS Zip, ORDERS.STATUSID AS OrderStatus, ORDERS.NOT" & _ "ES AS OrderNotes, ORDERS.DUEBY AS OrderDueBy, SERVICES.NAME AS ServiceName, ORDE" & _ "RS.ModifyTime AS LastModified FROM ORDERS INNER JOIN Users ON ORDERS.USERID = Us" & _ "ers.UserID INNER JOIN SERVICES ON ORDERS.SERVICEID = SERVICES.ID WHERE (ORDERS.S" & _ "TATUSID = 4)" Me.SqlSelectCommand1.Connection = Me.SqlConnection1 ' 'SqlConnection1 ' Me.SqlConnection1.ConnectionString = CType(configurationAppSettings.GetValue("SqlConnection1.ConnectionString", GetType(System.String)), String) ' 'DataSet11 ' Me.DataSet11.DataSetName = "DataSet1" Me.DataSet11.Locale = New System.Globalization.CultureInfo("en-US") CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit() End Sub Protected WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection Protected WithEvents DataSet11 As WebApplication_01.DataSet1 Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here SqlDataAdapter1.Fill(DataSet11) DataGrid1.DataBind() End Sub Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged End Sub Private Sub SqlDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlRowUpdatedEventArgs) Handles SqlDataAdapter1.RowUpdated End Sub Private Sub SqlConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlInfoMessageEventArgs) Handles SqlConnection1.InfoMessage End SubEnd Class(webform1.aspx)<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication_01.WebForm1"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <title>WebForm1</title> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 4px; POSITION: absolute; TOP: 4px" runat="server" DataSource="<%# DataSet11 %>" DataKeyField="Order#" DataMember="ORDERS"> <Columns> <asp:BoundColumn DataField="Record#" HeaderText="Record#"></asp:BoundColumn> <asp:BoundColumn DataField="Order#" HeaderText="Order#"></asp:BoundColumn> <asp:BoundColumn DataField="DateOpened" HeaderText="Date Opened"></asp:BoundColumn> <asp:BoundColumn DataField="DriverName" HeaderText="Driver Name"></asp:BoundColumn> <asp:BoundColumn DataField="Reference" HeaderText="Reference"></asp:BoundColumn> <asp:BoundColumn DataField="CustomerName" HeaderText="Customer Name"></asp:BoundColumn> <asp:BoundColumn DataField="StreetAddress" HeaderText="Street Address"></asp:BoundColumn> <asp:BoundColumn DataField="City" HeaderText="City"></asp:BoundColumn> <asp:BoundColumn DataField="State" HeaderText="State"></asp:BoundColumn> <asp:BoundColumn DataField="Zip" HeaderText="Zip"></asp:BoundColumn> <asp:BoundColumn DataField="OrderNotes" HeaderText="Order Notes"></asp:BoundColumn> <asp:BoundColumn DataField="OrderDueBy" HeaderText="Due By"></asp:BoundColumn> <asp:BoundColumn DataField="ServiceName" HeaderText="Service Type"></asp:BoundColumn> <asp:BoundColumn DataField="LastModified" HeaderText="Last Modified"></asp:BoundColumn> </Columns> </asp:DataGrid> </form> </body></HTML>(web.config)<?xml version="1.0" encoding="utf-8"?><configuration> <system.web> <!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to insert debugging symbols (.pdb information) into the compiled page. Because this creates a larger file that executes more slowly, you should set this value to true only when debugging and to false at all other times. For more information, refer to the documentation about debugging ASP.NET files. --> <compilation defaultLanguage="vb" debug="true" /> <!-- CUSTOM ERROR MESSAGES Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. Add <error> tags for each of the errors you want to handle. "On" Always display custom (friendly) messages. "Off" Always display detailed ASP.NET error information. "RemoteOnly" Display custom (friendly) messages only to users not running on the local Web server. This setting is recommended for security purposes, so that you do not display application detail information to remote clients. --> <customErrors mode="RemoteOnly" /> <!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None" "None" No authentication is performed. "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to its settings for the application. Anonymous access must be disabled in IIS. "Forms" You provide a custom form (Web page) for users to enter their credentials, and then you authenticate them in your application. A user credential token is stored in a cookie. "Passport" Authentication is performed via a centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. --> <authentication mode="Windows" /> <!-- AUTHORIZATION This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. --> <authorization> <allow users="*" /> <!-- Allow all users --> <!-- <allow users="[comma separated list of users]" roles="[comma separated list of roles]"/> <deny users="[comma separated list of users]" roles="[comma separated list of roles]"/> --> </authorization> <!-- APPLICATION-LEVEL TRACE LOGGING Application-level tracing enables trace log output for every page within an application. Set trace enabled="true" to enable application trace logging. If pageOutput="true", the trace information will be displayed at the bottom of each page. Otherwise, you can view the application trace log by browsing the "trace.axd" page from your web application root. --> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" /> <!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". --> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" /> <!-- GLOBALIZATION This section sets the globalization settings of the application. --> <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> </system.web> <appSettings> <!-- User application and configured property settings go here.--> <!-- Example: <add key="settingName" value="settingValue"/> --> <add key="SqlConnection1.ConnectionString" value="workstation id=MyID;packet size=4096;integrated security=SSPI;data source=MyServerName;persist security info=False;initial catalog=MySQLDataBaseName" /> </appSettings></configuration>
Hi,In vs.net 2003 I created a webapplication and by toolbox/data/SqlDataAdapter I created a connection andthe adapter. I added a dataset and all went OK.In created another webapplication, did the same procedure and I got the error above mentioned. How come ?Help is appreciated, Ger.
Our SQL Server 2005 db has an NT AuthorityNetwork Service login with public access. It is used from web services hosted by IIS 6.0 located on another server on the same network. So does this mean that any Windows Server 2003 box on our network has public access to the database? What about servers off of our network? Is there a way to limit this account to just a single server on our network?
Any way to find out who's causing "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." error in SQL Server error logs?
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAINUser'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers.