This has been documented elsewhere, but just in case you missed it…

Scenario: You have a custom editform.aspx where you made it all snazzy looking and then you decide to add a custom workflow or event handler to the list to handle data validation or business logic. When you try to submit updates you get a nasty error that looks like this:

The data source control failed to execute the update command.

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: Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control failed to execute the update command.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[DataFormWebPartException: The data source control failed to execute the update command.]

Microsoft.SharePoint.WebPartPages.DataFormWebPart.UpdateCallback(Int32 affectedRecords, Exception ex) +170

System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +4434003

Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit() +724

Microsoft.SharePoint.WebPartPages.DataFormWebPart.PerformCommit() +92

Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e) +61

Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +1906

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +50

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +39

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +321

Solution: Even though my server had the SP1 and the Infrastructure Update, I was still getting this error. Luckily, there’s a hotfix from March 2008 for this issue – http://support.microsoft.com/kb/949749

Advertisements