[菜鸟提问]从网上下了一个留言本的例子,运行时报一下错误,请问是什么原因?

waistcoats 2003-09-05 04:51:38
Server Error in '/' Application.
--------------------------------------------------------------------------------

操作必须使用一个可更新的查询。
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.OleDb.OleDbException: 操作必须使用一个可更新的查询。

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:


[OleDbException (0x80004005): 操作必须使用一个可更新的查询。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +66
ASP.default_aspx.Page_Load(Object obj, EventArgs e) +2004
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.510; ASP.NET Version:1.1.4322.510
...全文
154 32 打赏 收藏 转发到动态 举报
写回复
用AI写文章
32 条回复
切换为时间正序
请发表友善的回复…
发表回复
webdiyer 2003-09-08
  • 打赏
  • 举报
回复
你没有把bin文件夹的父文件夹配置成应用程序吧?
gong1 2003-09-07
  • 打赏
  • 举报
回复
配服务器和虚拟目录。
zjjszw 2003-09-06
  • 打赏
  • 举报
回复
還有:
你的虛擬目錄的名稱和你的專案名稱是不是一樣的
你的專案考下來后有沒有修改路徑﹐在 專案名稱.csproj.webinfo 文件中;
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
唉,可能是下载的程序本身就有问题,不过我下载的另一个程序也有这个问题,非常感谢你,我要回去了
zjjszw 2003-09-05
  • 打赏
  • 举报
回复
不關bin的事
每建立一個專案就會在bin目錄下面自動建立一個 專案名稱.dll 文件
只是我覺的奇怪
你考下來的時候專案名稱是g 但是你的dll文件怎么是gb
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
是啊,原来就是那样子啊,只不过里面有个bin的目录,里面有个gb.dll文件
zjjszw 2003-09-05
  • 打赏
  • 举报
回复
如果考下來的文件的專案名稱是g的話﹐還是用原來的專案名稱
因為要改的話就要改很多地方,很容易出問題。
在者,這句代碼有問題:

<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="gb.WebForm1" %>

我給你一句對的代碼﹐你對照一下﹕
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="s2_work1.WebForm2" %>
==============================================
s2_work1是我的專案名稱,webform2是頁面名稱.其中的一些地方要一一對應.
你的index頁面和webform1頁面是分別做不同的工作,怎么能撤在一起
是不是原來就是那個樣子?
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
zjjszw(阿丸)

但我改成gb也不行啊,真是麻烦你了,我实在是太菜了
zjjszw 2003-09-05
  • 打赏
  • 举报
回复
你的專案名稱本來是g
Source File: d:\inetpub\wwwroot\guest\g\index.aspx
index頁面在g目錄下面
但是你的webform1怎么在gb下面
Inherits="gb.WebForm1"
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
我另外下的一个留言薄的例子也有同样的问题
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
zjjszw(阿丸):

本来是g,不行,我改成了gb还是不行
zjjszw 2003-09-05
  • 打赏
  • 举报
回复
你的專案的名字是g還是gb?
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
谢谢 zjjszw(阿丸),现在还在啊~~~~

我照你说的都做过了,还是不行啊
zjjszw 2003-09-05
  • 打赏
  • 举报
回复
現在的問題是不能調用webform1這個頁面
Parser Error Message: Could not load type 'gb.WebForm1'.

你試一試這樣:
<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="gb.index" %>
或者這樣
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="gb.WebForm1" %>

好象是你現在的頁面對應的不對.


acewang 2003-09-05
  • 打赏
  • 举报
回复
你如果没有建立虚拟目录的话,就把你那个bin文件夹拷贝到你的根目录下面,比如
c:\Inetpub\wwwroot\
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
谢谢大家,请大家再拉兄弟一把把,现在就剩下上面的和这个问题了

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'gb.WebForm1'.

Source Error:


Line 1: <%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="gb.WebForm1" %>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 3: <HTML>


Source File: d:\inetpub\wwwroot\guest\g\index.aspx Line: 1


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.510; ASP.NET Version:1.1.4322.510

waistcoats 2003-09-05
  • 打赏
  • 举报
回复
现在又出了这个问题:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:


Line 36: “Passport”和“None”
Line 37: -->
Line 38: <authentication mode="Windows" />
Line 39:
Line 40: <!-- 应用程序级别跟踪记录


Source File: d:\inetpub\wwwroot\guest\g\web.config Line: 38


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.510; ASP.NET Version:1.1.4322.510
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
webdiyer(陕北吴旗娃) :

谢谢你,你说的问题已经解决,想不到也有大小写区分啊
ETstudio 2003-09-05
  • 打赏
  • 举报
回复
网站的数据库只可以放在指定的文件夹里,如果没有就不可以添加记录,所以会报错
waistcoats 2003-09-05
  • 打赏
  • 举报
回复
zjjszw(阿丸):

我的mu目录下有一个bin的目录,里面有一个gb.dll的文件,Inherits引用的是不是里面的类啊
加载更多回复(12)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧