本文介绍了SQL Server登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我收到以下错误: ********* 用户''AUM \ASPNET'登录失败'。 描述:在执行 当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取更多信息 关于错误及其在代码中的起源。 异常详细信息:System.Data.SqlClient.SqlException:用户登录失败 ''AUM \ASPNET''。 ********* 失败dbConnection.Open(); line 我使用以下连接(这是来自书中的教程): *********** * string connectionString = ConfigurationSettings.AppSettings [" ConnectionString"]; System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(connectionStri ng); string queryString ="从[粉丝]中选择计数([粉丝]。[FanEmail]) ([粉丝]。[FanEmail] = @FanEmail)" ;; System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand(); ************ 我正在使用本地SQL服务器(随我的VS.Net 2003一起安装。我怎么能 允许它登录或使用dbo用户来做数据库的东西吗? Thanx, - Anil Gupte www.keeninc.net www.icinema.com 解决方案 进入OSQL并输入: SP_GRANTLOGIN''AUM\ASPNET'' GO 使用您的数据库 GO SP_GRANTDBACCESS''AUM \ASPNET'',''ASPNET'' GO GRANT whateveryouwantaspnettobeabletodo to ASPNET GO Arne 这必须是ASP.NET 2003解决方案使用ASPNET工作进程使用 ASPNET帐户可以使用任何访问 a MS SQL Server数据库的ASP.NET解决方案。这似乎是这种情况,并且(机器 名称/ ASPNET)帐户必须是在MS SQL 服务器数据库上建立的帐户,具有完全访问权限数据库。 I am getting the following error:*********Login failed for user ''AUM\ASPNET''.Description: An unhandled exception occurred during the execution of thecurrent web request. Please review the stack trace for more informationabout the error and where it originated in the code.Exception Details: System.Data.SqlClient.SqlException: Login failed for user''AUM\ASPNET''.*********It is failing on the dbConnection.Open(); lineI am using the following to connect (this is from a tutorial in a book):************string connectionString =ConfigurationSettings.AppSettings["ConnectionString"];System.Data.IDbConnection dbConnection = newSystem.Data.SqlClient.SqlConnection(connectionStri ng);string queryString = "Select count([Fans].[FanEmail]) from [Fans] where([Fans].[FanEmail] = @FanEmail)";System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();************I am using a local SQL server (installed with my VS.Net 2003. How can Iallow it to login or use the dbo user to do the database stuff?Thanx,--Anil Gupte www.keeninc.net www.icinema.com 解决方案Go into OSQL and enter:SP_GRANTLOGIN ''AUM\ASPNET''GOUSE yourdatabaseGOSP_GRANTDBACCESS ''AUM\ASPNET'',''ASPNET''GOGRANT whateveryouwantaspnettobeabletodo TO ASPNETGOArneThis must be an ASP.NET 2003 solution with the ASPNET worker process usingthe ASPNET account coming into play with any ASP.NET solution that accessinga MS SQL Server database. This seems to be the case, and the (machinename/ASPNET) account must be an account that is established on the MS SQLServer database with full permissions to access the database. 这篇关于SQL Server登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-08 21:07