Login Failed For User in Sql Server Error

Google+ Pinterest LinkedIn Tumblr +

You may face login fail exception while making a connection to SQL Server database.Error appears something like this  

” 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:\inetpub\wwwroot\WebApplication2\Home.aspx.vb Line: 51″ 

This exception can be result that either user ‘me’ doesn’t exist or it doesn’t have proper access rights. In order too check existence of user in your SQL server

 Open ‘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 then check the access rights for that user by right clicking user and going to properties. Click on ‘Database Access’ tab. You can control which database can be accessed by that user by selecting that database from all databases list and assign appropriate database roles like Public, db_owner , db_accessadmin, db_securityadmin.

Start earning now, Join my network on Bukisa

.

Share.

About Author

Leave A Reply