用vs2005运行正常,用iis运行却出错,各位前辈帮帮我
用vs2005写的代码,在平台上运行是很正常的,可是当我用iis运行这个网站时,出现了下面的错误,各位前辈帮帮我.错误是:用户 '4D232D9C9196473\ASPNET' 登录失败。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 用户 '4D232D9C9196473\ASPNET' 登录失败。
源错误:
行 25: PagedDataSource ps = new PagedDataSource();
行 26: sqlconn = myCon.getCon();
行 27: sqlconn.Open();
行 28: string sqlstr = "select a.*,b.* from tb_Card as a join tb_Module as b on a.ModuleID=b.ModuleID";
行 29: SqlDataAdapter MyAdapter = new SqlDataAdapter(sqlstr, sqlconn);
源文件: c:\网站建设\mrBBS\mrBBS\Index.aspx.cs 行: 27
堆栈跟踪:
[SqlException (0x80131904): 用户 '4D232D9C9196473\ASPNET' 登录失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
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
Index.dlBind() in c:\网站建设\mrBBS\mrBBS\Index.aspx.cs:27
Index.Page_Load(Object sender, EventArgs e) in c:\网站建设\mrBBS\mrBBS\Index.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--------------------编程问答-------------------- 以前也遇过,不知怎么搞定的,应该是IIS配置的问题~ --------------------编程问答-------------------- just sql connection error. are you using windows authentication to connect to sql ? you can add ASPNET account into sql by using sql management studio and grant right to it ,or just using sql authentication.. --------------------编程问答-------------------- 在你的企业管理器---安全性--登陆--新建登陆--增加ASPNET用户---服务器角色选种System Administrators---数据库访问把你要访问的数据库选中. --------------------编程问答-------------------- 检查一下数据库登录信息,
补充:.NET技术 , C#