This is a migrated thread and some comments may be shown as answers.

Exception type: IndexOutOfRangeException

2 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Viswajit
Top achievements
Rank 1
Viswajit asked on 15 Apr 2014, 08:28 PM
I am getting the following error on a form grid:

Exception type: IndexOutOfRangeException
Exception message: Cannot find table 0.
   at System.Data.DataTableCollection.get_Item(Int32 index)
   at storagePortal.shipout.RadGrid1_NeedDataSource(Object source, GridNeedDataSourceEventArgs e)
   at Telerik.Web.UI.RadGrid.OnNeedDataSource(GridNeedDataSourceEventArgs e)
   at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason)
   at Telerik.Web.UI.RadGrid.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The web page was working fine yesterday.  Nothing changed that I know of, but this error is appearing today. The data source is provided by a stored procedure that I ran separately - it works fine.  Anyone have any ideas? 


2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Apr 2014, 05:31 AM
Hello,

As per your error message, Your stored procedure didn't return any result.
I think you assign Table[0] in radgrid datasource and it is not able to find the Table1 because result is null.

So, can you please check the stored procedure result?



Thanks,
Jayesh Goyani
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Apr 2014, 05:39 AM
Hello,

Please debug functionality of visual studio, please check from where this issue is raised.

If you are not able to solve your problem then please provide your code.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Viswajit
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or