This question is locked. New answers and comments are not allowed.
Hello,
This error comes up from time to time when I'm using the OpenAccessDataSource with RadGrid and I'd like some tips on troubleshooting it (beyond the obvious).
I can read data and add new records. However, updating or deleting a record results in the following error:
Here's the class where the error is occurring:
I've spent a ridiculous amount of time trying to solve this problem. Other classes in my project are identical in terms of the ID and version but work fine.
Please tell me what else I can look at or provide you to get to the bottom of this issue.
Thanks,
Jeff
This error comes up from time to time when I'm using the OpenAccessDataSource with RadGrid and I'd like some tips on troubleshooting it (beyond the obvious).
I can read data and add new records. However, updating or deleting a record results in the following error:
Changes are not possible if the primary key fields are not visible. |
Please specify the id and version fields in the persistent attribute. |
[Telerik.OpenAccess.Persistent(IdentityFied="id", VersionField="version"] |
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: Telerik.OpenAccess.Exceptions.UnsupportedException: Changes are not possible if the primary key fields are not visible. |
Please specify the id and version fields in the persistent attribute. |
[Telerik.OpenAccess.Persistent(IdentityFied="id", VersionField="version"] |
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: |
[UnsupportedException: Changes are not possible if the primary key fields are not visible. |
Please specify the id and version fields in the persistent attribute. |
[Telerik.OpenAccess.Persistent(IdentityFied="id", VersionField="version"]] |
Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.CreateObjectId(IDictionary keys, String& oldVersion) +230 |
Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +75 |
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92 |
Telerik.Web.UI.GridTableView.PerformUpdate(GridEditableItem editedItem, Boolean suppressRebind) +223 |
Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +975 |
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134 |
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 |
Telerik.Web.UI.GridEditFormItem.OnBubbleEvent(Object source, EventArgs e) +299 |
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 |
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118 |
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135 |
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 |
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 |
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 |
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 |
-------------------------------------------------------------------------------- |
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082 |
Here's the class where the error is occurring:
[Telerik.OpenAccess.Persistent(IdentityField = "m_ID", VersionField = "m_Version")] |
public class Address |
{ |
private int m_Version; |
public int Version |
{ |
get { return m_Version; } |
set { m_Version = value; } |
} |
private Guid m_ID; |
public Guid ID |
{ |
get { return m_ID; } |
set { m_ID = value; } |
} |
private string m_strAddress1 = ""; |
public string Address1 |
{ |
get { return m_strAddress1; } |
set { m_strAddress1 = value; } |
} |
private string m_strCity; |
public string City |
{ |
get { return m_strCity; } |
set { m_strCity = value; } |
} |
private string m_strState; |
public string State |
{ |
get { return m_strState; } |
set { m_strState = value; } |
} |
... more fields and properties... |
} |
I've spent a ridiculous amount of time trying to solve this problem. Other classes in my project are identical in terms of the ID and version but work fine.
Please tell me what else I can look at or provide you to get to the bottom of this issue.
Thanks,
Jeff