|
|
How to resolve SqlException: Login failed for user in ASP.net
Server Error in '/HMS' Application.
--------------------------------------------------------------------------------
Login failed for user 'me'.
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 'me'.
Source Error:
Line 49: Private Sub blogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles blogin.Click
Line 50: 'Server.Transfer("m_emp_dep.aspx", True)
Line 51: conn.Open()
Line 52: cmd.Connection = conn
Line 53: '
Source File: c:inetpubwwwrootWebApplication2Home.aspx.vb Line: 51
Stack Trace:
[SqlException (0x80131904): Login failed for user 'me'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
WebApplication2.Home.blogin_Click(Object sender, EventArgs e) in c:inetpubwwwrootWebApplication2Home.aspx.vb:51
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
i am facing this sqlexception in my asp.net application how to resolve it
Similar entries
- How to resolve SQLException SELECT permission denied in ASP.net page
- How to resolve "Failed to generate a user instance of SQL Server due to failure in
- Data Source Name(DSN) Connection to database in ASP using DSN
- Clear your private data before you leave
- solution to Access to the path is denied asp.net
- what is Reverse Address Resolution Protocol (RARP)
- Difference between ADO and ADO.NET
- error logging system for asp.net web application
- Networking terms:Protocol,Services,PDU and SDU
- How to backup your registry using System Restore
From your exception it seems either user me doesn't exist or it doesn't have proper access rights. to Check existense of user in your SQL server go to Enterprise Manager
go to Microsoft SQL Servers-> SQL Server group
Expand your Server
Go to Logins
Check whether the login for user me exist if it doesn't exist then right click and Select New Login and give proper access rights
If it is already there. check the access rights for database by right clicking and going to properties of said user.