|
按放入購物車出現如下錯誤,請老師救救我吧! '/' 應用程式中發生伺服器錯誤。 --------------------------------------------------------------------------------
運作必須使用更新查詢。 描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。
例外詳細資訊: System.Data.OleDb.OleDbException: 運作必須使用更新查詢。
原始程式錯誤:
行 62: ads.InsertParameters.Add("ProductName", CType(e.Item.FindControl("productnameLabel"), Label).Text) 行 63: ads.InsertParameters.Add("UnitPrice", CType(e.Item.FindControl("productpriceLabel"), Label).Text) 行 64: ads.Insert() 行 65: Else 行 66: ads.UpdateCommand = "UPDATE [cart] SET [Quantity] = [Quantity]+1 WHERE [cartCustomer] ='" & Session("cartName") & "' AND ProductID =" & DataList1.DataKeys(e.Item.ItemIndex)
原始程式檔: d:\WebHost\LocalUser\w005861w\a01\index.aspx.vb 行: 64
堆疊追蹤:
[OleDbException (0x80004005): 運作必須使用更新查詢。] System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106 System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +401 System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +447 System.Web.UI.WebControls.SqlDataSource.Insert() +13 index.DataList1_UpdateCommand(Object source, DataListCommandEventArgs e) in d:\WebHost\LocalUser\w005861w\a01\index.aspx.vb:64 System.Web.UI.WebControls.DataList.OnUpdateCommand(DataListCommandEventArgs e) +105 System.Web.UI.WebControls.DataList.OnBubbleEvent(Object source, EventArgs e) +249 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.DataListItem.OnBubbleEvent(Object source, EventArgs e) +117 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
-------------------------------------------------------------------------------- 版本資訊: Microsoft .NET Framework 版本:2.0.50727.832; ASP.NET 版本:2.0.50727.832 |