SQL Server登录失败 [英] SQL Server login failing

查看:61
本文介绍了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

解决方案

这是一个SQL Server问题,而不是C#语言问题 - 它会发生在任何
$ b $中b语言。


用户登录失败'AUM \\\\\\\\意味着您的应用程序已配置为

计算机上的默认ASPNET帐户,显然没有登录到SQL Server的
凭据,正在尝试登录in。


解决方案是在连接

字符串中使用指定的SQL Server登录,并确保混合模式 (Windows和SQL Server都有)
在SQL Server上启用
身份验证。


异常消息非常清楚。唯一的问题通常是我们只是简单地说b
不要花时间阅读和理解。

-

递归:见递归

网站: http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

BlogMetaFinder: http://www.blogmetafinder.com


" Anil Gupte"写道:


我收到以下错误:


*********

用户''AUM \ASPNET'登录失败。

描述:执行

当前网络请求时发生了未处理的异常。请查看堆栈跟踪以获取更多信息

关于错误及其在代码中的起源。


异常详细信息: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


Anil Gupte写道:


用户登录失败''AUM \ ASPNET''。

描述:在执行

当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取更多信息

关于错误及其在代码中的起源。


异常详细信息:System.Data.SqlClient.SqlException:用户登录失败

''AUM \ASPNET''。

*********


我正在使用本地SQL服务器(与我的VS.Net 2003一起安装。我怎么能让
允许它登录或使用dbo用户来做数据库的东西?



进入OSQL并输入:


SP_GRANTLOGIN''AUM\ASPNET''

GO

使用您的数据库

GO

SP_GRANTDBACCESS''AUM \ASPNET'',''ASPNET''

GO

GRANT whateveryouwantaspnettobeabletodo to ASPNET

GO


Arne


< blockquote>


我正在使用本地SQL服务器(随我的VS.Net 2003一起安装。我怎么能

a llow它登录或使用dbo用户来做数据库的东西?

Thanx,



这必须是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 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
''AUM\ASPNET''.
*********
It is failing on the dbConnection.Open(); line

I am using the following to connect (this is from a tutorial in a book):
************
string connectionString =
ConfigurationSettings.AppSettings["ConnectionString"];
System.Data.IDbConnection dbConnection = new
System.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 I
allow it to login or use the dbo user to do the database stuff?
Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com

解决方案

This is a SQL Server issue, not a C# Language issue - it would happen in any
language.

"Login failed for user ''AUM\ASPNET''" means your app is configured so that
the default ASPNET account on the machine, which obviously does NOT have
credentials to login to the SQL Server, is what is trying to log in.

The solution is to use a specified SQL Server login in the connection
string,and ensure that "Mixed mode" (both Windows and SQL Server)
authentication is enabled on the SQL Server.

The exception message is quite clear. The only problem is often we simply
don''t take the time to read it and comprehend.
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Anil Gupte" wrote:

I am getting the following error:

*********
Login failed for user ''AUM\ASPNET''.
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
''AUM\ASPNET''.
*********
It is failing on the dbConnection.Open(); line

I am using the following to connect (this is from a tutorial in a book):
************
string connectionString =
ConfigurationSettings.AppSettings["ConnectionString"];
System.Data.IDbConnection dbConnection = new
System.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 I
allow it to login or use the dbo user to do the database stuff?
Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com


Anil Gupte wrote:

Login failed for user ''AUM\ASPNET''.
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
''AUM\ASPNET''.
*********

I am using a local SQL server (installed with my VS.Net 2003. How can I
allow it to login or use the dbo user to do the database stuff?

Go into OSQL and enter:

SP_GRANTLOGIN ''AUM\ASPNET''
GO
USE yourdatabase
GO
SP_GRANTDBACCESS ''AUM\ASPNET'',''ASPNET''
GO
GRANT whateveryouwantaspnettobeabletodo TO ASPNET
GO

Arne


I am using a local SQL server (installed with my VS.Net 2003. How can I
allow it to login or use the dbo user to do the database stuff?
Thanx,

This must be an ASP.NET 2003 solution with the ASPNET worker process using
the ASPNET account coming into play with any ASP.NET solution that accessing
a MS SQL Server database. This seems to be the case, and the (machine
name/ASPNET) account must be an account that is established on the MS SQL
Server database with full permissions to access the database.


这篇关于SQL Server登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆