mappings please.
2008/9/30 Ramon Smits <[EMAIL PROTECTED]>
>
> My code fails on an update.
>
> + $exception {"Invalid index 14 for this
> SqlParameterCollection with
> Count=14."} System.Exception {System.IndexOutOfRangeException}
>
> Which seems logical as there are 14 items. The index supplied to the
> method is wrong and calculated by the following code in the
> AbstractEntityPersister.Dehydrate method:
>
>
> for (int i = 0; i < entityMetamodel.PropertySpan;
> i++)
> {
> if (includeProperty[i] &&
> IsPropertyOfTable(i, table))
> {
>
> PropertyTypes[i].NullSafeSet(statement, fields[i], index,
> includeColumns[i], session);
> index +=
> ArrayHelper.CountTrue(includeColumns[i]); //TODO: this
> is kinda slow...
> }
> }
>
> This results in the index be set to 14 and then calls:
>
> IdentifierType.NullSafeSet(statement, id, index,
> session);
>
> Which results in an Invalid index exception
>
>
> I really don't know what that for loop is doing but the sql statement
> contains a parameter collection which contains values that do not map
> correctly. The following query is generated:
>
>
> UPDATE
> xxx.dbo.yyy
> SET
> Name = @p0, --1
> Status_id = @p1, -- 20080925_3
> StartDateTime = @p2, -- 5
> Type_Id = @p3, -- {25-9-2008 12:15:00}
> Skin = @p4, -- null
> Start = @p5, --null
> End = @p6, --null
> StatsEnabled = @p7, --null
> Title = @p8,
> Creator = @p9,
> CustomerUrl = @p10,
> Process_Status = @p11,
> Customer_Id = @p12
> WHERE
> Id = @p13"
>
>
> The value of Status_Id should be assigned to Name... The value of
> StartDateTime to Status_Id, etc. and where I *think* but do not know
> for sure at the moment is that the value for @P1 (Name) should be the
> value for @p12. But I will try to test that with other data.
>
> I really do not know what is going wrong here. Anybody having ideas?
> >
>
--
Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---