This question is locked. New answers and comments are not allowed.
Hi Telerik.
I have a problem again. I can not update the image column DATA in my table via the RIA Services. Insert works fine, but update has the validation error "Index was outside the bounds of the array".
In Fidler log, you can see that the error was thrown by Telerik.OpenAccess.Ria.AttachChanges.FindChanges().
Thank you for your help.
Regards.
Peter
Fidler log
Update code example
Table definition
Entity
Rlinq
I have a problem again. I can not update the image column DATA in my table via the RIA Services. Insert works fine, but update has the validation error "Index was outside the bounds of the array".
In Fidler log, you can see that the error was thrown by Telerik.OpenAccess.Ria.AttachChanges.FindChanges().
Thank you for your help.
Regards.
Peter
Fidler log
@_SubmitChangesResponse__http://tempuri.org/@_SubmitChangesResult _a_DomainServices _i)http://www.w3.org/2001/XMLSchema-instance^_ChangeSetEntry^_Entity._type�b:W_USERDATA _b@http://schemas.datacontract.org/2004/07/WebTime11.Web.ANeTCommon__DATA�u_SerV3_����\System.DateTime, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e���������~�X̟____IXS_REF�TEST __KEY�_DateFrom__OpenAccessGenerated _c9http://schemas.microsoft.com/2003/10/Serialization/Arrays`_string��<?xml version="1.0" encoding="utf-16"?><ObjectKey T="WebTime11.Web.ANeTCommon.W_USERDATA" X="AAEAAAD/////AQAAAAAAAAAQAQAAAAQAAAAJAgAAAAkDAAAADQIRAgAAAAIAAAAGBAAAAANLRVkGBQAAAAdJWFNfUkVGEAMAAAACAAAABgYAAAAIRGF0ZUZyb20GBwAAAAxURVNUICAgICAgICAL" />_`_string�_+__^EntityActions._nil� _b9http://schemas.microsoft.com/2003/10/Serialization/Arrays_^_HasMemberChanges�^_Id�^ Operation�_Update^StoreEntity._type�b:W_USERDATA _b@http://schemas.datacontract.org/2004/07/WebTime11.Web.ANeTCommon__DATA�u_SerV3_����\System.DateTime, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e���������~�X̟____IXS_REF�TEST __KEY�_DateFrom__OpenAccessGenerated _c9http://schemas.microsoft.com/2003/10/Serialization/Arrays`_string��<?xml version="1.0" encoding="utf-16"?><ObjectKey T="WebTime11.Web.ANeTCommon.W_USERDATA" X="AAEAAAD/////AQAAAAAAAAAQAQAAAAQAAAAJAgAAAAkDAAAADQIRAgAAAAIAAAAGBAAAAANLRVkGBQAAAAdJWFNfUkVGEAMAAAACAAAABgYAAAAIRGF0ZUZyb20GBwAAAAxURVNUICAgICAgICAL" />_`_string�_+__^_ValidationErrors^_ValidationResultInfo^ ErrorCode��_^_Message�*Index was outside the bounds of the array.^_SourceMemberNames _b9http://schemas.microsoft.com/2003/10/Serialization/Arrays__string�_DATA_^StackTrace�8_ at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices) at System.Array.GetValue(Int32 index) at Telerik.OpenAccess.Ria.AttachChanges.IsDifferent(Object orig, Object client, Type t) at Telerik.OpenAccess.Ria.AttachChanges.FindChanges(ChangeSetEntry entry, List`1& changes)__^_ValidationResultInfo^ ErrorCode��_^_Message�*Index was outside the bounds of the array.^_SourceMemberNames _b9http://schemas.microsoft.com/2003/10/Serialization/Arrays__string�_DATA_^StackTrace�8_ at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices) at System.Array.GetValue(Int32 index) at Telerik.OpenAccess.Ria.AttachChanges.IsDifferent(Object orig, Object client, Type t) at Telerik.OpenAccess.Ria.AttachChanges.FindChanges(ChangeSetEntry entry, List`1& changes)______Update code example
ANeTCommonDomainContext dc = new ANeTCommonDomainContext();dc.Load(dc.GetWUSERDATAQuery().Where(userdata => ((userdata.IXS_REF == "TEST") && (userdata.KEY == key))), (o) => { W_USERDATA userdata = o.Entities.FirstOrDefault(); if (userdata != null) { userdata.DATA = new byte[5] {1,0,0,0,0}; } dc.SubmitChanges((op) => { if (op.HasError) op.MarkErrorAsHandled(); }, null);}, null);Table definition
CREATE TABLE [w_userdata] ( [key] varchar(255) NOT NULL, -- _KEY [ixs_ref] varchar(255) NOT NULL, -- _IXSREF [data] image NULL, -- _DATA CONSTRAINT [pk_w_userdata] PRIMARY KEY ([key], [ixs_ref]))Entity
namespace WebTime11.Web.ANeTCommon { public partial class W_USERDATA { private string _KEY; public virtual string KEY { get { return this._KEY; } set { this._KEY = value; } } private string _IXS_REF; public virtual string IXS_REF { get { return this._IXS_REF; } set { this._IXS_REF = value; } } private byte[] _DATA; public virtual byte[] DATA { get { return this._DATA; } set { this._DATA = value; } } }}Rlinq
<orm:class name="W_USERDATA" uniqueId="fe16e8a9-4a11-490e-be33-4a2d59c54647"> <orm:table name="w_userdata" /> <orm:identity> <orm:multiple-field> <orm:single-field field-name="_KEY" /> <orm:single-field field-name="_IXS_REF" /> </orm:multiple-field> </orm:identity> <orm:field name="_KEY" property="KEY" uniqueId="dfc7fd76-6cdf-4fe1-a393-cb8f6d672303" type="System.String"> <orm:column name="key" sql-type="varchar" nullable="false" length="255" scale="0" primary-key="true" ado-type="Varchar" /> </orm:field> <orm:field name="_IXS_REF" property="IXS_REF" uniqueId="35069e56-93fe-461e-993a-7b5838932067" type="System.String"> <orm:column name="ixs_ref" sql-type="varchar" nullable="false" length="255" scale="0" primary-key="true" ado-type="Varchar" /> </orm:field> <orm:field name="_DATA" property="DATA" uniqueId="27f456cd-ec1c-4cd2-ae91-6f3e20d69c62" type="System.Byte[]"> <orm:column name="data" sql-type="image" nullable="true" length="0" scale="0" ado-type="LongVarBinary" /> </orm:field> </orm:class>...<orm:table name="w_userdata"> <orm:column name="key" sql-type="varchar" nullable="false" length="255" scale="0" primary-key="true" ado-type="Varchar" /> <orm:column name="ixs_ref" sql-type="varchar" nullable="false" length="255" scale="0" primary-key="true" ado-type="Varchar" /> <orm:column name="data" sql-type="image" nullable="true" length="0" scale="0" ado-type="LongVarBinary" /></orm:table>