Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Table doesn't contain a row with the specified PrimaryKey value
posted

Dear All,

based on some filter fields I want to access a database and show the corresponding data in a webhierarchicaldatagrid ( master / detail relation ).

It seems that something go wrong when I first load whole datasource and in a second request only load a selection of the whole datasource.

To be more specific :

1) first I leave all fields empty and load all data from the database into the whdg.
-> I see all data, this is good

2) then I enter a specific value to search in the database
-> I should see 1 master row with 3 detail rows, but it returns the error below.

For each query in the database I receive two datatables which join in a dataset. for each datatable I create the proper primary keys and afterwards I specify the relation.

But unfortunately I still receive this error message, does someone recognise this error and know how to solve it or what I'm doing wrong?

Table myTable doesn't contain a row with the specified PrimaryKey value

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.RowNotInTableException: Table myTable doesn't contain a row with the specified PrimaryKey value

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:

[RowNotInTableException: Table myTable doesn't contain a row with the specified PrimaryKey value] Infragistics.Web.UI.Framework.Data.DataSetNode..ctor(DataSet dataSet, String dataPath) +854 Infragistics.Web.UI.Framework.Data.DataSetDataBot.GetData(String dataPath) +85 Infragistics.Web.UI.Framework.Data.HierarchicalDataBot.GetHierarchicalData(IHierarchicalDataObject dataObject) +62 Infragistics.Web.UI.GridControls.HierarchicalGridBindingManager.GetHierarchicalEnumerable(IHierarchicalDataObject rootObject, Object dataSource) +289 Infragistics.Web.UI.GridControls.HierarchicalGridBindingManager.RowIslandRowsCount(ContainerGrid rowIsland) +229 Infragistics.Web.UI.GridControls.ContainerGrid.get_TotalRowCount() +192 Infragistics.Web.UI.GridControls.ContainerGrid.SaveViewState() +181 Infragistics.Web.UI.GridControls.ContainerGrid.System.Web.UI.IStateManager.SaveViewState() +33 Infragistics.Web.UI.Framework.ObjectCollection.SaveViewStateItems() +191 Infragistics.Web.UI.Framework.ObjectCollection.SaveViewState() +74 Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.SaveViewState() +33 Infragistics.Web.UI.GridControls.ContainerGridRecord.SaveViewState() +136 Infragistics.Web.UI.Framework.ObjectBase.System.Web.UI.IStateManager.SaveViewState() +33 Infragistics.Web.UI.Framework.SparseObjectCollection.SaveViewStateItems() +197 Infragistics.Web.UI.Framework.ObjectCollection.SaveViewState() +74 Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.SaveViewState() +33 Infragistics.Web.UI.GridControls.WebDataGrid.SaveViewState() +383 Infragistics.Web.UI.GridControls.ContainerGrid.SaveViewState() +277 Infragistics.Web.UI.GridControls.ContainerGrid.System.Web.UI.IStateManager.SaveViewState() +33 Infragistics.Web.UI.GridControls.WebHierarchicalDataGrid.SaveViewState() +406 System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +50 System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148 System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148 System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148 System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148 System.Web.UI.Page.SaveAllState() +194 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2839