Another cryptic error message: System.IndexOutOfRangeException: Invalid index [number] for this SqlParameterCollection with Count=[number].

411 views
Skip to first unread message

goofballLogic

unread,
Mar 25, 2009, 2:19:56 PM3/25/09
to nhusers
Full error trace below. This error was caused by:
1. Using the one-table-per-class-heirarchy model with discriminator
column
2. I inadvertantly named the discriminator column the same thing as a
property of one of the classes

System.IndexOutOfRangeException: Invalid index 5 for this
SqlParameterCollection with Count=5.
at System.Data.SqlClient.SqlParameterCollection.RangeCheck(Int32
index)
at System.Data.SqlClient.SqlParameterCollection.GetParameter(Int32
index)
at
System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item
(Int32 index)
at NHibernate.Type.GuidType.Set(IDbCommand cmd, Object value, Int32
index)
at NHibernate.Type.NullableType.NullSafeSet(IDbCommand cmd, Object
value, Int32 index)
at NHibernate.Type.NullableType.NullSafeSet(IDbCommand st, Object
value, Int32 index, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Dehydrate
(Object id, Object[] fields, Object rowId, Boolean[] includeProperty,
Boolean[][] includeColumns, Int32 table, IDbCommand statement,
ISessionImplementor session, Int32 index)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object
id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql,
Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object
id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Action.EntityInsertAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions
(IEventSource session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush
(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()

Fabio Maulo

unread,
Mar 25, 2009, 3:24:57 PM3/25/09
to nhu...@googlegroups.com
mapping needed

2009/3/25 goofballLogic <goofba...@gmail.com>



--
Fabio Maulo
Reply all
Reply to author
Forward
0 new messages