win2003服务器+iis6+net4.0+access环境,运行时出错,小弟我把提示发出来,请大家帮忙给看看,多谢
win2003服务器+iis6+net4.0+access环境,运行时出错,我把提示发出来,请大家帮忙给看看,谢谢。
win2003服务器+iis6+net4.0+access环境
一个简单的C#操作accdb数据库网页,我在个人电脑上,用的是win7运行正常。可放到win2003服务器上后,就出错了,以下是提示,请大有帮看看。由于win7下的可以运行,我感觉代码是没问题的,是在服务器上设置的事吗?请大家给出详细讲解步骤,谢
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 23: //conn = new SqlConnection(str);
Line 24: conn = new OleDbConnection(str);
Line 25: conn.Open();
Line 26: }
Line 27:
Source File: d:\glms\yah5l\App_Code\SSqlHelp.cs Line: 25
Stack Trace:
[SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark) +31
System.Security.PermissionSet.Demand() +68
System.Data.Common.DbConnectionOptions.DemandPermission() +40
System.Data.OleDb.OleDbConnection.PermissionDemand() +47
System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection) +20
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.OleDb.OleDbConnection.Open() +43
SSqlHelp..ctor() in d:\glms\yah5l\App_Code\SSqlHelp.cs:25
News.Findadminspc(String bname, String classid) in d:\glms\yah5l\App_Code\datasql\News.cs:51
admin_l_admin.bind(String bname) in d:\glms\yah5l\adminis\l_admin.aspx.cs:52
admin_l_admin.Page_Load(Object sender, EventArgs e) in d:\glms\yah5l\adminis\l_admin.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.adminis_l_admin_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\387ad480\5eacd08\App_Web_tudxaq55.2.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
------解决方案--------------------
没有读写权限
------解决方案--------------------
应该是读写权限问题吧
------解决方案--------------------
try:
http://www.educity.cn/wenda/483811.html
win2003服务器+iis6+net4.0+access环境
一个简单的C#操作accdb数据库网页,我在个人电脑上,用的是win7运行正常。可放到win2003服务器上后,就出错了,以下是提示,请大有帮看看。由于win7下的可以运行,我感觉代码是没问题的,是在服务器上设置的事吗?请大家给出详细讲解步骤,谢
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 23: //conn = new SqlConnection(str);
Line 24: conn = new OleDbConnection(str);
Line 25: conn.Open();
Line 26: }
Line 27:
Source File: d:\glms\yah5l\App_Code\SSqlHelp.cs Line: 25
Stack Trace:
[SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark) +31
System.Security.PermissionSet.Demand() +68
System.Data.Common.DbConnectionOptions.DemandPermission() +40
System.Data.OleDb.OleDbConnection.PermissionDemand() +47
System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection) +20
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.OleDb.OleDbConnection.Open() +43
SSqlHelp..ctor() in d:\glms\yah5l\App_Code\SSqlHelp.cs:25
News.Findadminspc(String bname, String classid) in d:\glms\yah5l\App_Code\datasql\News.cs:51
admin_l_admin.bind(String bname) in d:\glms\yah5l\adminis\l_admin.aspx.cs:52
admin_l_admin.Page_Load(Object sender, EventArgs e) in d:\glms\yah5l\adminis\l_admin.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.adminis_l_admin_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\387ad480\5eacd08\App_Web_tudxaq55.2.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
------解决方案--------------------
没有读写权限
------解决方案--------------------
应该是读写权限问题吧
------解决方案--------------------
try:
http://www.educity.cn/wenda/483811.html