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
595
Manual CRUD (Update) - Table doesn't have a primary key
posted

Hi,

I've set some properties in the webdatagrid to enable manual CRUD. When I click on a new row after editing the data I get this error message.

I've not implemented any update code yet though? Only some code to see if the values where being passed to the server.

Any ideas what the grid is looking for?

DataKeyFields=Doc_Id

Binding is programatic on load of the page.

 

 

 

 

 

Protected Sub WebDataGrid1_RowUpdating(sender As Object, e As Infragistics.Web.UI.GridControls.RowUpdatingEventArgs) Handles WebDataGrid1.RowUpdating

lbErrorMsge.Text =

 

"Updating Doc_Id: " + e.Values("Doc_Id").ToString + ", Invoice_Type: " + e.Values("Invoice_Type").ToString

 

 

 

End

Table doesn't have a primary key.

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.MissingPrimaryKeyException: Table doesn't have a primary key.

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:

[MissingPrimaryKeyException: Table doesn't have a primary key.]
   Infragistics.Web.UI.Framework.Data.DataViewDataSourceAdapter.Update(Object dataItem, IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +1388
   Infragistics.Web.UI.Framework.Data.DataSourceObjectView.Update(Object dataItem, IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +62
   Infragistics.Web.UI.GridControls.EditingCore.OnAction(String actionType, Object id, Object value, Object tag) +3198
   Infragistics.Web.UI.GridControls.GridBehavior.Infragistics.Web.UI.GridControls.IGridBehavior.OnAction(String actionType, Object id, Object value, Object tag) +48
   Infragistics.Web.UI.GridControls.GridBot.LoadAdditionalClientState(Object state) +670
   Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +205
   Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent() +75
   Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +34
   System.Web.UI.Page.RaiseChangedEvents() +165
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485


Version Information: Microsoft .NET Framework Version:2.0.50727.5444; ASP.NET Version:2.0.50727.5420

Parents Reply Children
No Data