System.IndexOutOfRangeException bug in Enterprise Library 3.1

Topics: Data Access Application Block
Jun 11, 2009 at 10:48 AM

I am using Enterprise Library 3.1.   Always get below error in application log.  I have checked the code, no static Connection/Command/Reader.

just like


 ASP.NET 2.0.50727.0

Application ID: /LM/W3SVC/1/ROOT


Process ID: 6572


Exception: System.IndexOutOfRangeException


Message: sHotelID


StackTrace:     System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)

    System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)

    System.Data.SqlClient.SqlDataReader.get_Item(String name)



    System.Threading.ThreadHelper.ThreadStart_Context(Object state)

    System.Threading.ExecutionContext.runTryCode(Object userData)

    System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

    System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

    System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)



  .NET Runtime 2.0 Error Reporting

EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4, P5, P6 471ebf27, P7 151b, P8 1a, P9 system.indexoutofrangeexception, P10 NIL.

Could any confirm this?



Jun 11, 2009 at 11:33 AM

HI ,

I just found a article which was the silimar error mentioned.




Jun 15, 2009 at 3:23 AM

Is it also intermittent or you could repro it?  I'll try to use the regular ADO.NET to verify if this is its bug or EntLib's.  If you could also try doing this without requiring a lot of effort from you, that would be great.


Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.

Jun 17, 2009 at 2:15 AM

it is intermittent . And it seems a bug.

Jun 17, 2009 at 7:14 AM

Yes it does seem like it.  Did you try the suggestion mentioned in the other links? To modify the stored procedures to specify the names of the columns to select rather than using *? It's quite hard to repro, I must admit I haven't repro it using both plain and entlib.   Anyway, if I finally got to encounter it, i'll let you know.  That's all I can do for now, if it's an bug, that's something out of entlib's control. 


Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.