1
votes

I have a listview bound to a LinqDataSource

I have steped thorugh the code and it gets to this section of the .dbml file of the xx.designer.cs

public System.Data.Linq.Table<qtxt_Competition> qtxt_Competitions     
{
 get{     
     return this.GetTable<qtxt_Competition>();    
 }     
}

and once it passes the return it throws this error

at System.Web.UI.WebControls.QueryableDataSourceView.OriginalValueMatches(Object originalValue, Object value) at System.Web.UI.WebControls.QueryableDataSourceView.GetOriginalValues(IDictionary keys) at System.Web.UI.WebControls.QueryableDataSourceView.BuildUpdateObjects(IDictionary keys, IDictionary values, IDictionary oldValues, IDictionary`2 validationErrors) at System.Web.UI.WebControls.QueryableDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) at System.Web.UI.WebControls.ContextDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) at System.Web.UI.WebControls.LinqDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) at System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) at System.Web.UI.WebControls.ListView.HandleUpdate(ListViewItem item, Int32 itemIndex, Boolean causesValidation) at System.Web.UI.WebControls.ListView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.ListView.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.ListViewDataItem.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)

Ok the strange thing is that for some records it will update fine but for other it keeps throwing this error

Any ideas?

1

1 Answers

1
votes

I found the cause of this ambiguios error :)

If you have a Datakey in a list view which conatins null values in the database this is the resulting error.