Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2010, 02:31 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default IndexOutofRange Exception occurs in ASP 3.5

Hello,(Thanks for your time)

I'm getting the following runtime error message:

RowId

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.IndexOutOfRangeException: RowId

Source Error:

Line 125: pid = Convert.ToInt32(reader["RowId"]);

Stack Trace:

[IndexOutOfRangeException: RowId]

--------------
I get this error sometimes,But sometimes it works fine.

I have checked all the columns in the select statement, it contains RowID.

-i dont know where it went wrong.

me select statemet:

SELECT F.RowId, F.PredictionTopic, F.Memlgname, F.MemPrediction, F.UknowY,F.PredictedDate, C.Memvote, C.MemComments, C.CommUserName, C.CommentedDate FROM Forumtable
AS F LEFT OUTER JOIN CommentTable AS C ON F.RowId = C.RowId ORDER BY F.PredictedDate desc

-Thanks
-Appreciate your help

-
 
Old August 24th, 2010, 04:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you need to supply more information and code. AFAIK, the IndexOutOfRange exception could only occur when the column is missing. Maybe the SQL is dynamic and in some cases the column is indeed missing? Or maybe you get multiple result sets back?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 25th, 2010, 01:08 AM
Registered User
 
Join Date: Aug 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default RE:

Is this piece of code is in loop. Check the boundary condition , there might be chances that while execution of the above statement it was going out of boundary.

could you please put full code of your function.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Log When Edit Occurs in Gridview JB4375 BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 0 April 15th, 2009 10:10 AM
DataList DataBinding Error: IndexOutOfRange AnotherAspdotnetDeveloper ASP.NET 2.0 Professional 0 February 20th, 2007 05:51 AM
How to handle error or exception if it occurs popoxinhxan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 August 27th, 2006 06:44 PM
urgent: session timeout occurs unexpectedly seemagaur ASP.NET 1.0 and 1.1 Basics 0 October 10th, 2005 12:59 PM
How to know when an exception occurs? ecobo C# 2 December 30th, 2004 04:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.