Asked by:
Consistent Getting the following Error

Question
-
User403614158 posted
I am getting the following error quite often. Can someone shed some light on this? I am not sure why this is becoming more frequent. Thanks everyone. How do I fix this?
Server Error in '/' Application.
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
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: System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
Source Error:Line 23: (System.ComponentModel.DataObjectMethodType.Select, False)> _
Line 24: Public Shared Function List(ByVal pagenum As Integer) As IDataReader
Line 25: Dim qry As New Query(Tables.Announcements)
Line 26: qry.AddWhere(Announcements.Columns.Itemdate, Comparison.LessOrEquals, DateTime.Now())
Line 27: qry.PageSize = ClubStarterKit.Web.Settings.PageSize()
Source File: C:\HostingSpaces\somesite.com\wwwroot\App_Code\BLL\News.vb Line: 25
Stack Trace:[ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.]
System.Array.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer) +7514355
System.Collections.Generic.SortedList`2.IndexOfKey(TKey key) +80
System.Collections.Generic.SortedList`2.ContainsKey(TKey key) +4
SubSonic.DataService.GetSchema(String tableName, String providerName, TableType tableType) in C:\SubSonic 2.0.3\src\SubSonic\DataProviders\DataService.cs:418
SubSonic.DataService.GetTableSchema(String tableName, String providerName) in C:\SubSonic 2.0.3\src\SubSonic\DataProviders\DataService.cs:440
SubSonic.Query..ctor(String tableName) in C:\SubSonic 2.0.3\src\SubSonic\Sql Tools\Query.cs:613
ClubStarterKit.Web.News.List(Int32 pagenum) in C:\HostingSpaces\somesite.com\wwwroot\App_Code\BLL\News.vb:25
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +71
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +261
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +488
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247
System.Web.UI.WebControls.Repeater.GetData() +35
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +220
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
System.Web.UI.WebControls.Repeater.DataBind() +75
System.Web.UI.WebControls.Repeater.EnsureDataBound() +55
System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +15
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
Friday, September 7, 2012 3:12 AM
All replies
-
User-1760637409 posted
Hi,
I think these is some type mis-match between the the Object you are passing.
Check your code at below position :-
SubSonic.Query..ctor(String tableName) in C:\SubSonic 2.0.3\src\SubSonic\Sql Tools\Query.cs:613Also check what this "Tables.Announcements" is holding.
If this is a Annoouncement class then check whether it is Serialize or not.
Friday, September 7, 2012 6:50 AM -
User403614158 posted
Hi Rajesh Sawant,
I am not sure how to check what you have outlined. I am using the default VB version of ClubStarterKit and have made no changes to these classes. It must be a bug that I am sure otehrs are experiencing. I think the problem exists in the Announcement class the SubSonic query I assume is out of the box. How do I check what the Tables.Announcements is holding?
Thanks!
Friday, September 7, 2012 12:09 PM