Asaf ok

Asaf ok

  • NA
  • 14
  • 0

need help with an access query error message

Jul 7 2010 4:46 AM
Hello everyone,
I have a problem with an update query using the Access control - detailsView, I want to update data in the database for a catalog product with the possibility of uploading images.

Image uploading is done before carrying out general update of product data with a control FILEUPLOAD - image uploading and registering its name properly works without any problems.

The problem start when I click the update button in the DetailsView control, after saving the new picture name by SESSION.

the query format that includes the 2 (product name and picture) is:
 cmd.CommandText = string.Format("UPDATE [products] SET [cat_id] = 
@cat_id, [OldName] = @OldName ,[Name] = @Name,[Desc] =
@Desc,[Resistance] = @Resistance,[Weight] = @Weight, [Indoor] =
@Indoor,[Season] = @Season,[pic_small] = '{0}',[pic_big] =
@pic_big,[zOrder] = @zOrder WHERE [Name]='{1}'", fileName, productName




after committing The query the Error messge i get is:

System.Data.OleDb.OleDbException was unhandled by user code
  Message=No value given for one or more required parameters.
  Source=Microsoft JET Database Engine
  ErrorCode=-2147217904
  StackTrace:
       at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
       at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
       at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
       at Xadmin.dlsProduct_ItemUpdating(Object sender, DetailsViewUpdateEventArgs e) in \\wpsbs2003\users\Asaf\My Documents\Visual Studio 2010\WebSites\EatCatalog\Xadmin.aspx.cs:line 117
       at System.Web.UI.WebControls.DetailsView.OnItemUpdating(DetailsViewUpdateEventArgs e)
       at System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation)
       at System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
       at System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e)
       at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
       at System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e)
       at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
       at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
       at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException

Answers (1)